Checked Exception
- include Exception and all subclasses that do not extend RuntimeException
- will be checked in compiling time
- must be handled by try catch or throws or throw
- e.g. FileNotFoundException, IOException
Unchecked Exception
- include RuntimeException class and its subclasses
- could be checked in runtime
- not be forced to handle
- e.g. ArithmeticException, ArrayIndexOutOfBoundsException, ClassCastException, IllegalArgumentException, NullPointerException, NumberFormatException
Categories of Exception Types
,------.
|Object|
|------|
|------|
`------'
|
|
,---------.
|Throwable|
|---------|
|---------|
`---------'
| |
,---------. ,-----.
|Exception| |Error|
|---------| |-----|
|---------| |-----|
`---------' `-----'
|
|
,----------------.
|RuntimeException|
|----------------|
|----------------|
`----------------'
Reference
continue…