Common Exception Types
- Runtime Exceptions
They don’t have to be handled or declared. They can be thrown by the programmer or by the JVM Common runtime exceptions include the following:
- ArithmeticException, when devide by zero
- IllegalArgumentException, when an illegal or inappropriate argument
- Checked Exceptions
Checked exceptions have Exception in their hierarchy but not RuntimeException. They must be handled or declared.
Errors extend the Error class. They are thrown by the JVM and should not be handled or declared.
- ExceptionInInitializerError, when static initializer fails