Java Reference
In-Depth Information
} catch (NullPointerException e)
{
System.out.println (“caught inside demopro. “);
Throw e;
}
}
Public static void main (string args [ ] {
Try {
Demopro ( );
}
Catch (NullPointerException e) {
System.out.println (recatch: “+ e);
}
}
}
Finally
It is a code that is used in executing before or after the try and catch block is executed or
completed.
Syntax
Class finally dem
{
Static void pro x ( )
{
Try
{
System.out.println (“in proc x”);
Throw new runtimeException (“demo”);
Search WWH ::




Custom Search