Professional Documents
Culture Documents
What is an Exception :
Classification of Errors :
Exception Propagation
The five Key Words to handle Exceptions in Java
try
catch
finally
throw
throws
Java’s UnChecked Exceptions :
ArithmeticException
ArrayIndexOutOfBoundsException
ArrayStoreException
ClassCastException
NegativeArraySizeExcetption
IllegalArgumentException
NullPointerException
NumberFormatException
SecurityException
ClassNotFoundException
IllegalAccessException
InstantiationException
InterruptedException
general form
try
{
<Statements>
}
catch(exception type1<parameter1>)
{
<statement>
}
....
...
...
catch(exception typen<parametern>)
{
<statement>
}
finally
{
<statement>
}
--------------------
RuntimeException
---------------
IndexOutofBoundsException
NullPointerException
Exception
ArithmeticException
IOException
FileNotFoundExcep
EOFException
Throwable
Object
Exception Hierarchy :
--------------------
Error
---------------
VirtualMechanicError
Simple try, catch block
2. Get the int modifer Using getModifers() method from Class ref