Page 377 - CITS - Computer Software Application -TT
P. 377
COMPUTER SOFTWARE APPLICATION - CITS
6 statement 6;
7 statement 7;
8 statement 8;
9 statement 9;
10 statement 10;
Suppose there are 10 statements in a Java program and an exception occurs at statement 5; the rest of the code
will not be executed, i.e., statements 6 to 10 will not be executed. However, when we perform exception handling,
the rest of the statements will be executed. That is why we use exception handling in Java.
Hierarchy of Java Exception classes
The java.lang.Throwable class is the root class of Java Exception hierarchy inherited by two subclasses: Exception
and Error. The hierarchy of Java Exception classes is given below:
364
CITS : IT&ITES - Computer Software Application - Lesson 101 - 108