ExceptionHandleing in java,
January 16, 2009 at 9:34 PM
in java exception is an object.that describes some expectional condition.that has occured in the piece of code when an exception arises.object repergenting the exception is created and thrown. generally exceptions are system generated exceptions and our code manually generate the exceptions.system generated exceptions are throw in the java runtime system.manually generated exceptions report some error codition. in java exception handleing via five key wrods.key wrods are try,catch,throw,throws,finally ex: class example{ public static void main(String args)throws Exception{ int a=0; int b=2/a; } } in the above lines of the code runtime sytem throws ArithmaticException.in java when the exception is arises it must be hadle by exception handler in the above lines of the we doesnot provide any exception handler .java runtime system calls the default exception handler.in the default exception handler reprot the string(contains the which line of the code exception arised that type of the information specified) :the main useful of the example handleing to prevent the immedeitely terminating the program throw: using throw we can throw an exception explicitly