Skip to content
Sharp

Exceptions · interview question

Which statement is true about the 'finally' block in exception handling?

Multiple choiceMediumchapter-6-curatedpremiumexceptionscustom-exceptions
Choose one answer
Answer and explanation

Correct answer

B. It always executes regardless of whether an exception is thrown.

Why

The 'finally' block is executed after the try and catch blocks, regardless of whether an exception was thrown, making it ideal for resource cleanup.

Test yourself on Exceptions

A free test with instant, explained results. No account needed.

Start free test
All Exceptions questions →