1Z0-811 Control Flow and Loops Practice Question
A developer writes: for(int i=0; i<10; i++) { if(i%2==0) continue; System.out.print(i); }. What is the output?
⚠ Common exam trap
A common mix-up: candidates confuse the `continue` statement with `break` or misread the condition `i%2==0` as selecting odd numbers, leading them to choose the even-number output (02468) or the full range.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
13579
The loop iterates from i=0 to i=9. The `continue` statement skips the rest of the loop body when the condition `i%2==0` is true (i.e., when i is even). Therefore, only odd values of i (1, 3, 5, 7, 9) are printed, producing the output '13579'. Option B is correct.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
0123456789
Why it's wrong here
Ignores continue.
- ✓
13579
Why this is correct
Correctly prints odd numbers.
- ✗
02468
Why it's wrong here
Prints even numbers, but continue skips even numbers.
- ✗
123456789
Why it's wrong here
Includes 0 which is even.
Go deeper
Related to this question
About these practice questions
One of 481 original 1Z0-811 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-811 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-811 exam.