Courseiva
Exception Handling and Development ToolshardMultiple ChoiceObjective-mapped

1Z0-811 Exception Handling and Development Tools Practice Question

A method declares throws FileNotFoundException and SQLException. Which statement about the caller is true?

⚠ Common exam trap

Test-takers frequently think they can choose to handle only one exception or ignore checked exceptions entirely, forgetting that Java's checked exception mechanism requires every declared checked exception to be either caught or re-declared by the caller.

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 caller must handle or declare both exceptions.

In Java, when a method declares checked exceptions (like FileNotFoundException and SQLException) in its throws clause, any caller must either handle each checked exception with a try-catch block or declare them in its own throws clause. The compiler enforces this rule to ensure that checked exceptions are properly accounted for, preventing unhandled checked exceptions from propagating unchecked.

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 caller must catch only FileNotFoundException.

    Why it's wrong here

    Both exceptions must be handled or declared.

  • The caller can declare throws Exception to cover both.

    Why it's wrong here

    Declaring throws Exception is allowed but not the only option; also, it's not a must.

  • The caller must handle or declare both exceptions.

    Why this is correct

    Each checked exception must be handled or declared.

  • The caller can ignore both exceptions.

    Why it's wrong here

    Checked exceptions must be handled or declared.

About these practice questions

This 1Z0-811 question is part of Courseiva's 481-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.