1Z0-829 Controlling Program Flow Practice Question
Given: for(int i=0; i<10; i++) { if(i%2==0) continue; System.out.print(i+" "); } What is the output?
⚠ Common exam trap
Watch out — candidates often confuse `continue` with `break`, or mistakenly think `continue` skips the current iteration entirely (including the increment), leading them to select the even numbers or no output at all.
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
✓
1 3 5 7 9
The loop iterates from 0 to 9, and the `continue` statement skips the rest of the loop body when the condition `i % 2 == 0` is true (i.e., for even numbers). Only odd numbers (1, 3, 5, 7, 9) are printed, each followed by a space.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
1 3 5 7 9
Why this is correct
Correct: even numbers are skipped.
- ✗
No output
Why it's wrong here
Incorrect; odd numbers are printed.
- ✗
0 2 4 6 8
Why it's wrong here
Incorrect; those are even numbers, which are skipped.
- ✗
0 1 2 3 4 5 6 7 8 9
Why it's wrong here
Incorrect; even numbers are skipped.
Go deeper
Related to this question
About these practice questions
One of 513 original 1Z0-829 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-829 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-829 exam.