Skip to main content

Posts

Showing posts with the label Exception

Exception Handling

Exception Handling:- Exception is a class in java which is child class of Throwable class and Throwable is child class of Object class. Exception is a kind of error which is occurred by the mistake of programmer or developer and exception is recoverable. So for the exception developer is responsible. In a java when the thing is not declare or not exist and we are try to access such thing than on the particular that place exception object automatically created and that object is disturb the flow of program and terminate the program abnormally. The purpose of the exception handling is that to manage the flow of the program, program should terminate normally and ignore that part only where exception occurred. For managing such type of facility we have to use.  try-catch or finally block Syntax for try-catch try {   } catch(Exception e) {   } We can use multiple catch block try { } catch(Exception1 e) { } catch(Exception2 e) { }...