public class ExceptionTest1
{
	int[] intArray = { 1 };
	
	public ExceptionTest1()	
	{
		// nothing needs to be done here
	}
	
	public static void main(String[] argv)
	{
		System.out.println("Main Called");
		ExceptionTest1 etest = new ExceptionTest1();
		etest.doMethodA();
	}
	
	public void doMethodA()
	{
		// something safe-no Exceptions thown here
		System.out.println("Method A Called");
		// call doMethodB here
		doMethodB();
	}
	
	public void doMethodB()
	{
		System.out.println("Method B Called");
		// something careless-access past end of array
		for(int i = 0; i <= intArray.length; i++)
		{
			System.out.println("Index " + i +
				" Value: " + intArray[i]);
		}
		System.out.println("Method B Done!");
	}
}
