by, 02-18-2012 at 04:12 PM (930 Views)
Any unexpected, abnormal & extra-ordinary condition which occurs in Java program at runtime is known as Exception. Examples of events or conditions are as following:
• Not able to get the “connection exception”
• “File not found” exception
In all these conditions, throw an exception object. Such exceptions are considered to be the Java objects. A java error exception can’t be escaped.
Error conditions are being handled by the Java Exception handling by taking necessary systematic actions in a program. Specific exceptions are handled by the Exception handlers or group of exceptions could be handled by the help of generic exception handler. In other case when exceptions of a program are not handled then Java runtime environment would be handling it.
Exception is Error class’s subclass which are the Throwable class’s subclass. Throw keyword raises Java exceptions and catch block handles it.