In Java, exceptions are divided into two main categories: checked and unchecked exceptions. Here’s a clear breakdown to help you grasp the difference:
✅ Checked Exceptions
- These are checked at compile-time.
- Java forces you to either handle them using
try-catch
or declare them usingthrows
. - They represent recoverable conditions, like file not found, network issues, or database access errors.
Example:

Common checked exceptions:
IOException
SQLException
FileNotFoundException
⚠️ Unchecked Exceptions
- These are not checked at compile-time—they occur at runtime.
- Java does not require you to handle them explicitly.
- They typically represent programming bugs, like logic errors or improper use of APIs.
Example:

Common unchecked exceptions:

🧠 Quick Summary:
Feature | Checked Exceptions | Unchecked Exceptions |
---|---|---|
Checked at compile-time? | Yes | No |
Requires handling? | Yes (try-catch or throws ) | No handling required |
Extends which class? | Exception (but not RuntimeException ) | RuntimeException |
Examples | IOException , SQLException | NullPointerException , ArithmeticException |
Think of checked exceptions like seatbelts—you must buckle up before driving (compiling). Unchecked exceptions are more like potholes—Java won’t stop you, but you might hit one if you’re not careful.