COMP201 Topic 7 / Slide 22 Catching Multiple Exceptions Can have multiple catchers for multiple types of exceptions: public static void main(String[] args) { try { BufferedReader in = new BufferedReader( new FileReader(args[0])); Employee[] e = readData(in); … } catch(IOException e1) { exception.printStackTrace(); } catch(ArrayIndexOutOfBoundsException e2) { System.out.print( No file name provided ); System.exit(1); } } // ExceptionTest2.java What if GeneralSecurityException occurs in the try block.
{}