import java.util.*; class Except { public static void e1() { // divide by zero int x=0; System.out.println(10/x); } public static void e2() { // null pointer String s = null; String s1 = s.toString(); } public static void e3() { // string format System.out.printf("%i", 3.4); } public static void e4() { // array indexing int[] arr = new int[10]; System.out.println( arr[10] ); } public static void e5() { // ArrayList indexing ArrayList arr = new ArrayList(); System.out.println( arr.get( new Integer(10) ) ); } public static void e6() { // bad input Scanner userin = new Scanner(System.in); int i = userin.nextInt(); } public static void main(String[] args) { e5(); } }