Professional Documents
Culture Documents
9.Exception Handling Types
9.Exception Handling Types
9.Exception Handling Types
Handling - Types
Types of exception
Error Exception
Out of Can be handled by
programmer’s the programmer
hand Ex: Out of
memory
Checked Unchecked
Compiler force the
programmer to handle
Exception Exception
Run time Exception
Exception
Ex:
Ex: SQLException
NullPointerException
follows:
Throwable
Exception Error
ArrayIndexOutOfException ArithmeticException
ClassCastException NullPointerException
Throwable
Error Exception
ArithmeticException
NumberFormatException
NullPointerException
IndexOutOfBoundException
The class RuntimeException and all its subclasses are categorized as Unchecked
Exceptions
If there is any chance of an unchecked exception occuring in the code, it is ignored during
compilation
Error Exception
ArithmeticException
NumberFormatException
NullPointerException
ClassCastException
if(num == 0)
return;
else
recursivePrint(++num);
}
List 1:
a. int[] A; List 2:
A[0] = 0; 1__ClassNotFoundException
b. The JVM starts running your program,
2__checked exception
but the JVM can't find the required Java classes.
c. A program is reading a stream and not yet reached 3__compile time error
the end of stream marker. 4__no exception
d. FileNotFoundException