Leave a Reply 3

Your email address will not be published. Required fields are marked *


imyrta

imyrta

Answer: D

Explanation:
Assuming that the code is write like this:

int[][] array = { { 0 }, { 0, 1 }, { 0, 2, 4 }, { 0, 3, 6, 9 }, { 0, 4, 8, 12, 16 } };
System.out.println(array[4][1]);
System.out.println(array[1][4]);

An ArrayIndexOutOfBoundException is thrown at this point System.out.println(array[1][4]) because the first array element does not have 4 elements in it.

If the code is like the one showed above than we will have a compilation errors since the code syntax is not the correct one.