Courseiva
Controlling Program FlowmediumMultiple SelectObjective-mapped

1Z0-829 Controlling Program Flow Practice Question

Which two statements about the break statement are true?

⚠ Common exam trap

Oracle often tests the misconception that break can only be used in loops, when in fact it is also valid in switch statements, and that labeled break can only target loops, when it can target any labeled statement.

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

break without a label terminates the innermost loop or switch.

An unlabeled break statement terminates the innermost enclosing loop (for, while, do-while) or switch statement, as defined by the Java Language Specification. Option E is correct because break is valid inside a switch statement to exit the switch block. Option A is incorrect; break cannot be used inside an if statement unless that if is inside a loop or switch, but the break itself must be directly inside the loop/switch. Option C is incorrect because break can also be used in a switch, not only in loops. Option D is incorrect; a labeled break terminates the statement with the matching label, which could be any labeled statement (block, loop, or switch), not necessarily the outermost loop or switch.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • break can be used inside an if statement.

    Why it's wrong here

    Incorrect; break only works inside a loop or switch.

  • break without a label terminates the innermost loop or switch.

    Why this is correct

    Correct: it exits the immediate enclosing loop or switch.

  • break can only be used inside a loop.

    Why it's wrong here

    Incorrect; it can also be used in a switch statement.

  • break with a label terminates the outermost matching loop or switch.

    Why it's wrong here

    Incorrect; it terminates the labeled statement, which is not necessarily outermost matching.

  • break can be used inside a switch statement.

    Why this is correct

    Correct: break is commonly used in switch statements.

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 →

How Courseiva writes practice questions · Editorial policy

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.