class MultipleTryBlock
{
public static void main(String arg[])
{
try
{
System.out.println("Hii");
try
{
System.out.println("Going To Divide");
System.out.println(4/0);
}
catch(ArithmeticException e)
{
System.out.println("Divide Error");
}
try
{
int a[]=new int[5];
a[5]=7;
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("Range Out");
}
}
catch(Exception e)
{
System.out.println("Handled");
}
System.out.println("Finished");
}
}

Like this:
Like Loading...
Related
catch, Exception Handling, JAVA, Java Program, Java Tutorial, multiple try block, Program, try, Tutorials