Skip to content
Sharp

Exceptions · interview question

Which of the following is a valid reason to extend Exception rather than RuntimeException for a custom exception?

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

Correct answer

B. The exception represents a recoverable condition that the caller should handle.

Why

Extending Exception (checked exception) is suitable when the error condition can be reasonably expected to be handled by the caller, encouraging explicit error handling.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →