Tuesday 25 February 2014

exception hierarchy

Exception Hierarchy


Throwable is the super class for all the exceptions in Java. Error, Exception are the two direct known subclasses for the Throwable class.

Error is a subclass of the Throwable, where a program can't handle. Exception is a sub class of the class Throwable, where program can handle.

Examples of Errors are

VirtualMachineError, InternalError, OutOfMemoryError, StackOverflowError.

Suppose if your program using the maximum heap and unable to allocate memory for new object, then OutOfMemoryError occurs. Definitely, your program can't handle the error.


java7 support for suppressed exceptions                                                 error vs exception                                                 Home

No comments:

Post a Comment