All errors and exceptions inherit from Throwable:
- Checked Exceptions (e.g.,
IOException,SQLException): Checked at compile time—you must handle them withtry-catchor declarethrows. - Unchecked Exceptions (subclasses of
RuntimeExceptionlikeNullPointerException,ArithmeticException): Occur at runtime due to logic bugs. - Errors (
OutOfMemoryError,StackOverflowError): Serious JVM failures your app shouldn't try to catch.
ADVERTISEMENT