Error handling in Java.
When a hard failure or link failure occurs in virtual machine, JVM throws an Error. These Errors are not caught by the typical java programs.
When a problem occurs in the code, an Exception is thrown and is caught by the program explicitly. Base class of all Exception classes is Exception class. All other are derived classes. Below image shows a complete hierarchy of the exceptions in java. Throwable and subclasses
One of the key aspects of programming is understanding how to handle exceptions. An exception is a problem that prevents the continuation of the current method or scope. Itís important to distinguish an exceptional condition from a normal problem, in which you have enough information in the current context to somehow cope with the difficulty. With an exception, you cannot continue processing because you lack the information necessary to address the problem in its current context. The only recourse
Updated 11-30-2011 at 04:19 AM by Java Exception