Sunday, 24 June 2012

nested try in exception handling

nested try in exception handling


class nestedtrydemo
{
public static void main(String args[])
{
try
{
int a=1;
int b=22/a;
System.out.println("a"+a);
try
{

int c[]={1};
c[42]=99;
}


catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("array exception");
}
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("array exception");
}

}
}


No comments:

Post a Comment