import java.util.Scanner; import java.io.*; public class ExEx { public static void main(String[] args) { System.out.println(); int[] nums = {3,5,6,7}; try { for (int i=0; i < nums.length; i++) { System.out.println("nums[" + i + "] is " + nums[i] + " "); } System.out.println("\nSome other stuff happened."); // int num = 5/0; String hi = "Hi!"; char c = hi.charAt(5); } catch (ArrayIndexOutOfBoundsException ex) { System.err.println("A problem occurred."); ex.printStackTrace(); } catch (ArithmeticException ex) { System.err.println("Brush up on your math skillz."); ex.printStackTrace(); } catch (Exception ex) { System.err.println("Some other sort of exception happened."); } System.out.println("\nWhat a nice array that was.\n"); } //main }