Exception handling in java???
before describing technical definition, first of all elaborate what is exception?
Exception stands an event that disrupts the normal flow of the program. It is an object which is thrown at run time.
Technical definition it is an mechanism to handle runtime errors such as classnotfound, SQL, remote etc.
Core Advantage of Exception Handling:
It is to maintain the normal flow of the application. Exception normally disrupts the normal flow of the application that is why we use exception handling.
Let's take an e.g.
Suppose there is 10 statements in your program and there occurs an exception at statement 5, rest of the code will not be executed i.e. statement 6 to 10 will not run. If we perform exception handling, rest of the statement will be executed. That is why we use exception handling in java.
TYPES OF EXCEPTION:
There are mainly two types of exceptions: checked and unchecked where error is considered as unchecked exception.
The sun microsystem says there are three types of exceptions: