Given this code fragment:
What is the result?
A multidimensional Java array is an array whose components can reference subarrays, and an array’s length is not part of its type. Therefore, the two int[] assignments of lengths 4 and 2 are valid. The enhanced for loops print the elements of the first assigned array as 1 3 5 7 and those of the second as 1 3, each on its own line.
int[]
for
1 3 5 7
1 3
Community Discussion