Skip to content
Sharp

Exceptions · interview question

When should you choose to not catch an exception in your code?

Multiple choiceMediumchapter-6-curatedpremiumexceptionsreliable-java-error-design
Choose one answer
Answer and explanation

Correct answer

B. When you cannot meaningfully handle the exception.

Why

If you cannot handle an exception meaningfully, it is better to propagate it to a higher level where it can be handled appropriately, rather than catching it and doing nothing.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →