import java.io.*; /** * Project #5.4 * CS 2334, Section 001 * Sept 23, 2002 *

* This classs implements a program that shows how we can use multiple catch blocks. *

* @author unknown * @version 1.0 */ public class MultipleCatch { /** * This is the main method for this test program. Since this is a * simple test program, all of our code will be in the main method. * Typically this would be a bad design, but we are just testing out * some features of Java. *

* @param args Contains the command line arguments. */ public static void main(String[] args) { try { int[] data; data = new int[10]; data[10] = 0; //oops } /* catch (ArrayIndexOutOfBoundsException indexout) { System.out.println("This created an ArrayIndexOutOfBoundsException"); } catch (RuntimeException runtime) { System.out.println("This created a Runtime Exception"); } */ catch (Exception exception) { System.out.println("This created an Exception"); } } }