Given:
1. class Main { 2. public static void main(String[] args) { 3. int[][] a = {{1,2}, {3,4}}; 4. int[] b = (int[]) a[1]; 5. Object o1 = a; 6. int[][] a2 = (int[][]) o1; 7. int[] b2 = (int[]) o1; 8. System.out.println(b[1]); 9. } }
What is the result? (Choose all that apply.)
P:C is correct.
A ClassCastException is thrown at line 7 because o1 refers to an int[][], not an int[].
If line 7 were removed, the output would be 4.