1 6 7 public class Finally2Catches implements org.quilt.cl.RunTest { 8 private int a, 9 b, 10 c; 11 private int array[] = {0, 1, 2, 3, 4, 5}; 12 13 public Finally2Catches() { 14 } 15 16 public int runTest(int x) { 17 a = 2; b = 3; c = 5; int d; try { 22 a *= a; d = 1/x; d = array[x]; if (x==2) { 26 throw new IllegalArgumentException (); 27 } 28 } catch (ArithmeticException e) { 29 a *= a; throw e; 31 } catch (ArrayIndexOutOfBoundsException e) { 32 a *= a; } finally { 34 b *= b; } 36 c *= 5; return a*b*c; } 39 } 40 | Popular Tags |