Java Program that Implement the Nested try Statements

Java Program that Implement the Nested try Statements:-

class NestedTry
{
public static void main(String args[])
{ int a=args.length;
try{
int d=42/a;
try
{
if(a==1){
int c= a/(a-a);}
if(a==2)
{
int c[]={2,3,4};
c[5]=90;
}
}
catch(ArrayIndexOutOfBoundsException e)
{e.printStackTrace();
}
}
catch(ArithmeticException e)
{
e.printStackTrace();
}
}
}

Related Posts