In Java, 2D arrays are arrays of arrays with possible different lengths (there is no guarantee that in 2D arrays that arrays of the second dimension all have the same length)
You can get the length of any 2-dimensional array as z[n].length where 0 <= n < z.length .
If you treat your 2D array as a matrix, you can simply get z.length and z[0].length , but note that you can make the assumption that for each array in the second dimension the length is the same (for some programs this may be a reasonable assumption).
Mark Elliot Nov 06 '10 at 1:22 2010-11-06 01:22
source share