This question can be phrased in various ways, but essentially it seeks to clarify the hierarchy of exception classes. This is detailed in the
documentation.
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 with throw 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 (excluding RuntimeException) – Represents checked exceptions.