Skip to content
Sharp

Exceptions · interview question

Which approach is the safest default when handling exceptions?

Multiple choiceMediumchapter-6-curatedpremiumexceptionstry-catch-finally
Choose one answer
Answer and explanation

Correct answer

A. Log the exception details and rethrow if necessary

Why

It is a best practice to log exception details to maintain transparency and rethrow if necessary to allow higher-level handling, ensuring the program can decide an appropriate course of action.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →