1Z0-811 Exception Handling and Development Tools Practice Question
Which TWO of the following are best practices for exception handling in Java?
⚠ Common exam trap
Oracle often tests the distinction between catching specific exceptions versus generic ones, and the trap here is that candidates may think catching Exception is a safe default, not realizing it hides important error details and violates best practices.
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 specific exceptions rather than generic Exception or Throwable.
Catching specific exceptions (e.g., IOException, SQLException) allows you to handle each error condition appropriately, rather than using a broad catch-all like Exception or Throwable which can mask unexpected bugs and make code harder to maintain. This follows the principle of precise exception handling, ensuring that only recoverable or expected exceptions are caught, while letting runtime exceptions propagate.
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 specific exceptions rather than generic Exception or Throwable.
Why this is correct
Specific exceptions allow precise handling and avoid catching unexpected errors.
- ✗
Always catch Exception in every method to prevent crashes.
Why it's wrong here
Overly broad catching hides bugs and should be avoided except at top-level handlers.
- ✓
Use try-with-resources for classes that implement AutoCloseable.
Why this is correct
try-with-resources ensures resources are closed automatically and properly.
- ✗
Throw an exception from a finally block to ensure cleanup failures are reported.
Why it's wrong here
Throwing from finally can mask the original exception; it's better to log or add suppressed exceptions.
- ✗
Ignore exceptions by leaving the catch block empty.
Why it's wrong here
Empty catch blocks swallow exceptions, making debugging difficult.
Go deeper
Related to this question
About these practice questions
One of 481 original 1Z0-811 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-811 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-811 exam.