Multidimensional Arrays in Java
A 2D array is an array of arrays. int[][] m = {{1, 2}, {3, 4}}; m[1][0] is row 1, column 0 → 3. Indexes start at 0.
Rows can have different lengths (jagged): new int[3][]; then m[0] = new int[2]; m[1] = new int[5];. Nested loops visit every cell: for i, for j.
Length — m.length is rows. m[i].length is columns in that row. Out of range still throws ArrayIndexOutOfBoundsException.
Let's take this on the board with one tiny Main class — no extra files. Multidimensional Arrays in Java — m[1][0] is row 1, column 0 → 3. Start from main, go line by line, and stop at each print. That output is the proof for Multidimensional Arrays.
index → 0 1 2
array → [10, 20, 30]
↑ ↑
first length-1Say array of arrays. Show m[1][0]. Mention jagged if asked.