Courseiva
Exception Handling and Development ToolsmediumMultiple ChoiceObjective-mapped

1Z0-811 Exception Handling and Development Tools Practice Question

What is the output if an ArithmeticException occurs in the try block and there is a finally block?

⚠ Common exam trap

Oracle often tests the misconception that the `finally` block only runs if no exception occurs, or that it can handle exceptions like a `catch` block, leading candidates to choose Option A or B.

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 finally block executes, then the method throws the exception.

In Java, the `finally` block always executes after the `try` block, regardless of whether an exception occurs. If an `ArithmeticException` is thrown in the `try` block, the `finally` block runs first, and then the exception propagates up the call stack to be handled by an appropriate exception handler or the default handler.

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 exception is caught and handled by the finally block.

    Why it's wrong here

    finally does not catch exceptions; it's for cleanup.

  • The finally block does not execute if an exception occurs.

    Why it's wrong here

    finally always executes unless JVM exits.

  • The finally block executes, then the method throws the exception.

    Why this is correct

    finally runs, then exception propagates.

  • The method exits immediately without executing finally.

    Why it's wrong here

    finally executes even on exception.

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.