1Z0-829 Controlling Program Flow Practice Question
Which two of the following statements are true about the continue statement in a loop?
⚠ Common exam trap
Candidates often confuse continue with break, or mistakenly think continue is restricted to for loops only, when in fact it works in all loop types (while, do-while, for) but not in switch or standalone try blocks.
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
✓
continue can be used in a while loop.
The continue statement can be used in any loop construct in Java, including while loops. When executed, continue skips the remaining body of the loop for the current iteration and proceeds to the next iteration's condition check.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
continue can be used in a while loop.
Why this is correct
continue is valid in a while loop to skip the current iteration.
- ✗
continue cannot be used in a do-while loop.
Why it's wrong here
continue can be used in a do-while loop.
- ✓
continue can be used in a for loop.
Why this is correct
continue is valid in a for loop to skip the current iteration.
- ✗
continue can be used in a switch statement.
Why it's wrong here
continue cannot be used in a switch; it is only for loops.
- ✗
continue can be used in a try block without a loop.
Why it's wrong here
continue is only valid inside a loop.
Go deeper
Related to this question
About these practice questions
This 1Z0-829 question is part of Courseiva's 513-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.