Exceptions in Java are categorized as either checked or unchecked. Checked exceptions must be declared in the method signature under the
throws
section; they must be caught or declared in the throws
clause of any method that calls them. Unchecked exceptions may be but are not required to be declared. They are not necessarily be caught, even if listed in throws
.Throwable
– The base class for everything that can be used withthrow
and caught within a try-catch block.RuntimeException
– Represents "normal" unchecked exceptionsError
– Unchecked exceptions that indicate serious problems with the application. They are not intended to be caught (although technically possible). Theoretically, the JVM might be in an invalid state and no longer able to guarantee behavior.Exception
(excludingRuntimeException
) – Represents checked exceptions.