Question 312 of 513
1Z0-829 Handling Exceptions Practice Question
Which TWO are valid multi-catch statements in Java 17? (Choose two.)
⚠ Common exam trap
The trap here is that candidates often forget the rule that multi-catch types must be unrelated in the class hierarchy, leading them to incorrectly select options that include a parent and child exception (like Exception and RuntimeException) or a subclass and its superclass (like IOException and FileNotFoundException).
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
✓
catch (SQLException | IOException e)
Java 17 allows a multi-catch clause to handle multiple exception types in a single catch block, provided the exception types are unrelated in the class hierarchy. SQLException and IOException are both checked exceptions that do not inherit from each other, so they can be caught together in a multi-catch statement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
catch (SQLException | IOException e)
Why this is correct
Valid; they are unrelated.
- ✗
catch (Exception | RuntimeException e)
Why it's wrong here
RuntimeException is a subclass of Exception, so invalid.
- ✗
catch (SQLException | Exception e)
Why it's wrong here
SQLException is a subclass of Exception, so invalid.
- ✗
catch (IOException | FileNotFoundException e)
Why it's wrong here
FileNotFoundException is a subclass of IOException, so invalid.
- ✓
catch (IOException | RuntimeException e)
Why this is correct
Valid; they are unrelated.
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: Jun 25, 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.