Skip to content
Sharp

Exceptions · interview question

Why does a 'catch' block in exception handling matter in this design?

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

Correct answer

C. To handle exceptions thrown by the try block.

Why

A 'catch' block is used to handle exceptions that are thrown in the associated 'try' block, allowing the program to recover from errors and continue execution.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →