Java Reference
In-Depth Information
Java programs, most exceptions derived from
RuntimeException
are automatically avail-
able. Furthermore, they need not be included in any method's
throws
list. In the language
of Java, these are called
unchecked exceptions
because the compiler does not check to
see if a method handles or throws these exceptions. The unchecked exceptions defined in
must be included in a method's
throws
list if that method can generate one of these excep-
tions and does not handle it itself. These are called
checked exceptions
. In addition to the
exceptions in
java.lang
, Java defines several other types of exceptions that relate to other
packages, such as
IOException
mentioned earlier.
Table 9-2
The Unchecked Exceptions Defined in
java.lang