Courseiva
Question 77 of 513
Handling ExceptionshardMultiple ChoiceObjective-mapped

1Z0-829 Handling Exceptions Practice Question

Exhibit

Refer to the exhibit.
```
Exception in thread "main" java.lang.RuntimeException: Error processing order
    at com.example.OrderService.process(OrderService.java:25)
    at com.example.OrderService.main(OrderService.java:10)
Caused by: java.sql.SQLException: Connection timeout
    at com.example.db.DatabaseConnection.connect(DatabaseConnection.java:15)
    at com.example.OrderService.process(OrderService.java:22)
    ... 1 more
```

Given the stack trace, which statement is true about the exception handling?

⚠ Common exam trap

Test-takers frequently confuse the 'must handle or declare' rule for checked exceptions with the idea that unchecked exceptions cannot be caught at all, leading them to incorrectly select Option D.

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 SQLException is a checked exception, and the code must handle it or declare it.

SQLException is a checked exception (a subclass of Exception but not RuntimeException), so the Java compiler enforces that it must be either caught in a try-catch block or declared in the throws clause of the enclosing method. The stack trace indicates that an SQLException occurred, and the code must handle this checked exception to compile successfully.

Answer analysis

Option-by-option breakdown

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

  • Both exceptions are checked, and the code must handle both.

    Why it's wrong here

    Only SQLException is checked; RuntimeException is unchecked.

  • The RuntimeException is caused by a checked exception, so it must be declared in the throws clause.

    Why it's wrong here

    RuntimeException is unchecked; it does not need to be declared. The cause being checked does not require declaration of the wrapper.

  • The SQLException is a checked exception, and the code must handle it or declare it.

    Why this is correct

    SQLException is checked and must be handled or declared.

  • The RuntimeException is an unchecked exception, so it cannot be caught.

    Why it's wrong here

    Unchecked exceptions can be caught; they are not required to be handled but can be.

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 →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

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.

Loading comments…

Sign in to join the discussion.

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.