Skip to content
Sharp

Exceptions · interview question

Why can catching the Exception class in Java become a real problem?

Multiple choiceMediumchapter-6-curatedpremiumexceptionsexceptions-basics
Choose one answer
Answer and explanation

Correct answer

D. It may catch unintended exceptions and obscure the root cause of errors.

Why

Catching the Exception class may lead to catching unexpected exceptions, making it difficult to diagnose the root cause of errors and potentially handling exceptions that should have been propagated.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →