>> How do I find the number of rows in a multi dimensional array? The
>> number of columns can quite easily be found with A[0].length, but
>> Java unlike Matlab does not allow an expression like A[][0].length
> There are A.length rows, if I understand you correctly.
Yup, that works. In response to the rest of the discussion, the multi
dimensional array was ensured to have columns of equal length prior to
the call. Thank you for your help.

Signature
Newsoffice.de - Die Onlinesoftware zum Lesen und Schreiben im Usenet
Die Signatur läßt sich nach Belieben anpassen ;-)
Lew - 15 May 2008 13:58 GMT
>>> How do I find the number of rows in a multi dimensional array? The
>>> number of columns can quite easily be found with A[0].length, but
[quoted text clipped - 5 lines]
> dimensional array was ensured to have columns of equal length prior to
> the call. Thank you for your help.
The reason it works is that A (which, as Roedy pointed out, is misnamed by
starting with an upper-case letter) does not have "rows" at all.
If you think correctly of what a Java array is, then the answer becomes
obvious. Arrays are single-dimensional only - your /a/ is an array of arrays.
Of course a.length represents how many of those it has. Since you
*interpret* an element of /a/ as a "row", then it immediately follows that
a.length represents the number of rows.

Signature
Lew