Intermediate Java
Q43 / 100

What is the purpose of the try-catch-finally block?

Correct! Well done.

Incorrect.

The correct answer is C) Exception handling; finally always runs regardless of whether an exception occurred

C

Correct Answer

Exception handling; finally always runs regardless of whether an exception occurred

Explanation

try contains code that might throw, catch handles specific exceptions, and finally always executes — useful for cleanup like closing streams.

Progress
43/100