Question 141 of 513
1Z0-829 Handling Exceptions Practice Question
Given a method that throws IOException, SQLException, and TimeoutException, a developer writes a catch block that rethrows the exception. Using Java 17, which exception types can the catch block declare in its throws clause if the rethrown exception is not modified?
⚠ Common exam trap
The trap is that candidates think they must declare each checked exception individually in the throws clause when rethrowing, but Java's precise rethrow allows a single common supertype.
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
✓
Any single exception type that covers all caught exceptions.
In Java, when a catch block catches multiple exception types and rethrows the exception without modification, the compiler uses precise rethrow. This allows the throws clause to declare any exception type that is a supertype of all the caught exceptions, such as Exception (which is a common supertype of IOException, SQLException, and TimeoutException). Therefore, the developer does not need to list each checked exception individually; a single covering type is sufficient. Option D correctly states that any single exception type covering all caught exceptions can be declared.
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 method must declare all checked exceptions individually.
Why it's wrong here
This is incorrect. Java's precise rethrow allows declaring a common supertype instead of listing each checked exception individually.
- ✗
Only the common superclass of the exceptions (Exception).
Why it's wrong here
This is incorrect because while Exception is a valid common supertype, the phrase 'only' is misleading; the throws clause can declare any covering type, not just Exception.
- ✗
No throws clause is needed if the catch block logs and returns.
Why it's wrong here
This is incorrect because if the catch block rethrows the exception, a throws clause is still required regardless of logging or returning.
- ✓
Any single exception type that covers all caught exceptions.
Why this is correct
This is correct. The throws clause can declare any single exception type that covers all the caught exceptions, thanks to precise rethrow.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jul 4, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.