1Z0-829 Controlling Program Flow Practice Question
Which TWO statements about the break and continue statements in Java are correct?
⚠ Common exam trap
Many candidates confuse the behavior of continue in different loop types (for vs. while) and incorrectly assume it skips condition reevaluation, or they mistakenly think break can only target loops and switches, ignoring its use with labeled 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
✓
The break statement without a label always terminates the innermost enclosing loop or switch.
The break statement without a label, when executed inside a loop or switch, immediately terminates the innermost enclosing loop or switch construct. This is defined by the Java Language Specification (JLS §14.15), which states that an unlabeled break statement transfers control to the immediately enclosing statement of the break target.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The break statement without a label always terminates the innermost enclosing loop or switch.
Why this is correct
break without a label exits the innermost loop or switch.
- ✓
The continue statement can be used inside any loop, including for, while, and do-while loops.
Why this is correct
continue is valid in all loop types.
- ✗
The continue statement can be used inside a switch statement to skip the rest of the switch body.
Why it's wrong here
continue cannot be used in a switch unless the switch is inside a loop, and it would target the loop, not the switch.
- ✗
The break statement can be used only inside loops and switch statements.
Why it's wrong here
break can also be used in labeled blocks, so 'only' is incorrect.
- ✗
The continue statement without a label skips the current iteration and proceeds to the next iteration without reevaluating the loop condition.
Why it's wrong here
continue does reevaluate the loop condition in while and do-while loops; in for loops, it executes the increment statement then checks condition.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 1Z0-829 question from scratch — 513 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.