Mastering Java: The Ultimate 2025 All-In-One Quiz to Excel in 'Thinking in Java

Question: 1 / 510

What happens to an exception thrown in a finally block?

It must be caught within the same finally block

It can cause previously thrown exceptions to be lost

When an exception occurs within a finally block, it can cause previously thrown exceptions to be lost. This is because the finally block will handle and use up the exception, preventing it from being caught or propagated to the outer scope. The other options are incorrect because A is not true, as exceptions can be caught outside of the finally block; C is not true, as the Java runtime will handle and display the exception if it is not caught in the finally block; and D is not true, as the exception is only rethrown if it is unhandled by the finally block.

Get further explanation with Examzify DeepDiveBeta

It is ignored by the Java runtime

It automatically gets rethrown after the finally block completes

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy