🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Java Arrays: all 10 questions

Quiz: Java Arrays · Question 5 of 10

What does grid.length give for int[][] grid = new int[3][5];?

What does grid.length give for int[][] grid = new int[3][5];?

  1. A.3
  2. B.5
  3. C.15
  4. D.8
Answer & explanation

Correct answer: 3

grid.length is the number of rows (3); grid[0].length is the number of columns (5).

Can you get the rest right without peeking?

Take the timed Quiz: Java Arrays quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →