class MyException
{
public static void main(String args[])
{
try
{
int
a = args.length;
int
b = 42/a;
int
c[] = {1};
c[50]
= 25;
}
catch(ArithmeticException
e)
{
System.out.println("DIVIDE
BY:" + e);
}
catch(ArrayIndexOutOfBoundsException
e)
{
System.out.println("ARRAY
INDEX:" + e);
}
finally
{
System.out.println("FINISHED");
}
}
}
OUTPUT
:
No comments:
Post a Comment