Skip to content
Sharp

Exceptions · interview question

Why does the difference between checked and unchecked exceptions in Java matter in practice?

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

Correct answer

A. Checked exceptions must be declared in a method's throws clause.

Why

Checked exceptions are checked at compile-time, meaning they must be either declared in the method signature or handled with a try-catch block. Unchecked exceptions, on the other hand, do not have this requirement and occur at runtime.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →