http://www.blogjava.net/fhtdy2004/archive/2009/06/18/283133.html
http://onjava.com/pub/a/onjava/2003/11/19/exceptions.html
Types of Exceptions in Java
Java defines two kinds of exceptions:
-
Checked exceptions: Exceptions that inherit from the
Exception
class are checked exceptions. Client code has to handle the checked exceptions thrown by the API, either in acatch
clause or by forwarding it outward with thethrows
clause. -
Unchecked exceptions:
RuntimeException
also extends fromException
. However, all of the exceptions that inherit fromRuntimeException
get special treatment. There is no requirement for the client code to deal with them, and hence they are called unchecked exceptions.
By way of example, Figure 1 shows the hierarchy for NullPointerException
.
Figure 1. Sample exception hierarchy