Concept

How do you declare and allocate a two-dimensional array in Java?

ComputerScienceOne / Multidimensional Arrays

"Java supports multidimensional arrays, though we’ll only focus on 2-dimensional arrays. To declare and allocate 2-dimensional arrays, we use two square brackets with two specified dimensions.\n\nint matrix[][] = new int[10][20];\n\nThe use of the keyword final only prevents us from changing the array reference, not modifying its contents."

Related Ideas

How do you declare and allocate a two-dimensional array in Java? | ComputerScienceOne | Bifalgorithm | Bifalgorithm