What will the following class print ?
public class Main { public static void main(String[] args) { int[][] a = { { 00, 01 }, { 10, 11 } }; int i = 99; try {/* ww w.j a v a2 s. c om*/ a[getIndex()][i = 1]++; } catch (Exception e) { System.out.println(i + ", " + a[1][1]); } } static int getIndex() throws Exception { throw new Exception("unimplemented"); } }
Select 1 option
Correct Option is : A
While evaluating a[val()
][i= 1]++, when val()
throws an exception, i= 1 will not be executed.
i remains 99 and a[1][1] will print 11.