Skip to content
Sharp

Exceptions · interview question

Which principle is important when deciding between a checked and unchecked exception for a custom exception?

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

Correct answer

A. Whether the caller can reasonably recover

Why

If the caller can reasonably be expected to recover from an error condition, a checked exception should be used. If the error is programming-related and not usually recoverable, an unchecked exception is appropriate.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →