Java Exception Hierarchy
- The Throwable class is the root class for java exception hierarchy.
- The Throwable class defines two child classes.
- Exception
- Error
1.Exception:-
Most of the time exceptions are occurs by our java program and these are recoverable.
for example: -
In our java program, there is a requirement of reading data from a remote file which is locating at NewYork (USA). At runtime, if NewYork file is not available our program should not be terminated abnormally and we will get RunTime exception saying"FileNotFoundException". To solve this problem we have to provide some local file to continue rest of the program normally.