Skip to content
Sharp

Exceptions · interview question

Why might you choose to throw an unchecked exception instead of a checked exception?

Multiple choiceEasychapter-6-curatedpremiumexceptionschecked-vs-unchecked-exceptions
Choose one answer
Answer and explanation

Correct answer

C. When the error is due to a programming mistake.

Why

Unchecked exceptions are typically used for programming errors, such as logic mistakes or incorrect API usage. They do not require explicit handling, signaling to developers that these exceptions should be fixed in the code.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →