Given:
1. public class Main { 2. public static void main(String[] args) { 3. int [][] ia2; 4. int [] ia1 = {1,2,3}; 5. Object o = ia1; 6. ia2 = new int[3][3]; 7. ia2[0] = (int[])o; 8. ia2[0][0] = (int[])o; 9. } }
What is the result? (Choose all that apply.)
E is correct.
Remember that arrays are objects, and that each array dimension is a separate type.
So, for instance, ia2 is of type "two dimensional int array", which is a different type than ia1.
Line 8 attempts to assign a one-dimensional array into an int.
A, B, C, and D are incorrect because lines 4-7 perform legal array manipulations.
F and G are incorrect based on the above.