View RSS Feed

Advanced Java

Java Exception Classes

Rate this Entry
by , 02-18-2012 at 04:17 PM (1642 Views)
Java exceptions are basically java objects. An object is thrown when you throw a java exception. It is not possible to throw any object as an exception. Only those objects whose classes descend from Throwable.
Throwable serves as the base class for all classes and it is declared in java.lang. Your program can instantiate and throw it.

Following picture shows a part of this family.

Name:  1.JPG
Views: 1093
Size:  19.8 KB
Java Exception Classes

As it is shown in the figure, Throwable has two direct subclasses.

Exception
Error

Exceptions are thrown to signal abnormal conditions and it can be handled by the try catch block.
Errors are thrown for serious issues like OutOfMemoryError and are not easy to handle.

Submit "Java Exception Classes" to Facebook Submit "Java Exception Classes" to Digg Submit "Java Exception Classes" to del.icio.us Submit "Java Exception Classes" to StumbleUpon Submit "Java Exception Classes" to Google

Categories
Exception

Comments