28.6k views
3 votes
Assume int[][] x = {{1, 2}, {3, 4}, {5, 6}}. what are x.length and x[0].length?

User Mclafee
by
6.2k points

1 Answer

2 votes
X.length is 3 because x holds 3 int[] and x[0].length is 2 because {1,2} has two elements
User Christian Klauser
by
5.9k points