//D
public class
SmallHeadache2
{
public static void
main(String[] args)
{
System.out.println("i");
try
{
System.out.println("ii");
yokes();
System.out.println("iii");
}
catch (IndexOutOfBoundsException e)
{
System.out.println("iv");
}
System.out.println("v");
}
public static void yokes()
{
System.out.println("1");
yikes();
System.out.println("2");
}
public static void yikes() throws IndexOutOfBoundsException
{
int[] a = {4,5,6};
System.out.println("A");
a[-1]=4; //creates exception
System.out.println("B");
}
}
|