What is printed to the console after the code that follows is executed?

What is printed to the console after the code that follows is executed?

int[][] types = new int[4][];
for (int i = 0; i < types.length; i++)
{
types[i] = new int[i+1];
}
System.out.println(types[1].length);

a. "3"
b. code doesn't compile
c. "1"
d. "4"
e. "2"


Answer: e. "2"


Learn More :