Exceptions Flashcards
1
Q
Checked and Unchecked Exceptions
A
Checked exceptions are verified at compile time.
Checked exceptions must be either thrown or handled with a try-catch block otherwise a compilation error will be thrown.
Unchecked exceptions are thrown at runtime and represent problems that are the result of a programming problem.
Here’s the bottom line guideline: If a client can reasonably be expected to recover from an exception, make it a checked exception. If a client cannot do anything to recover from the exception, make it an unchecked exception.