1Z0-829 Controlling Program Flow Practice Question
A developer has a method that contains a try-catch-finally block inside a while loop. The try block throws a checked exception that is caught by the catch block. The catch block throws a new runtime exception. What is the behavior?
⚠ Common exam trap
The trap here is that candidates mistakenly think the finally block or the loop's condition allows the loop to continue, but the runtime exception thrown in the catch block immediately propagates, terminating the loop.
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 loop terminates immediately, and the runtime exception propagates.
When a checked exception is caught and the catch block throws a new runtime exception, the finally block executes before the runtime exception propagates. Since the runtime exception is thrown from within the catch block (inside the while loop), it immediately terminates the loop and propagates up the call stack. Option B is correct because the loop does not continue; the runtime exception is thrown after the finally block completes.
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 loop continues after the finally block, and the runtime exception is thrown after the loop.
Why it's wrong here
The exception is thrown immediately after finally, not after the loop.
- ✓
The loop terminates immediately, and the runtime exception propagates.
Why this is correct
The runtime exception thrown in catch causes the loop to exit and the exception to propagate.
- ✗
The loop continues after the catch block, and the runtime exception is not propagated.
Why it's wrong here
The catch block throws an exception, so the loop does not continue.
- ✗
The loop continues after the finally block, and the runtime exception is suppressed.
Why it's wrong here
The runtime exception is not suppressed; it propagates after finally.
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.