import java.io.*; public class ExceptionMain { public static void main (String [ ] args) { ExceptionHandling.try1(); } // method main } // class ExceptionMain class ExceptionHandling { public static void try1() { System.out.println ("start of try1"); try { try2(); } // try catch (IOException e) { System.out.println (e + "something went wrong with IO"); } // catch System.out.println ("end of try1"); } // method try1 public static void try2() throws IOException { System.out.println ("start of try2"); try3(); System.out.println ("end of try2"); } // method try2 public static void try3() throws IOException { System.out.println ("start of try3"); throw new IOException ("IO error in method try3: "); } // method try3 } // class ExceptionHandling