previous | index | next

Checked vs Unchecked Exceptions

What is the difference between checked and unchecked exceptions in Java?

Checked exception conditions are detected at compile time and the programmer is forced to handle or throw them. Unchecked exception conditions are not detected.

Give an example of each.

I/O exceptions like "file not found" are checked. Run-time exceptions like "null pointer" are not checked.


previous | index | next