Throwable has two direct subclasses, Exception and Error.
Exceptions (members of the Exception family) are thrown to signal abnormal conditions that can often be handled by some catcher, though it's possible they may not be caught and therefore could result in a dead thread.
Errors (members of the Error family) are usually thrown for more serious problems, such as OutOfMemoryError, that may not be so easy to handle.
In general, code you write should throw only exceptions, not errors.Errors are usually thrown by the methods of the Java API, or by the Java virtual machine itself.
Checked exceptions are subject to the Catch or Specify Requirement. All exceptions are checked exceptions, except for those indicated by Error, RuntimeException, and their subclasses.
In Detail :
http://www.javaworld.com/javaworld/jw-07-1998/jw-07-exceptions.html?page=1a
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/RuntimeException.html
No comments:
Post a Comment