The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
June 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


length of nested arrays

Posted by DaB on June 07, 2000 at 2:00 PM

> > How can I reference the size of a 2-dimensional/3-dimensional array using "array.length" ? Thanks!

> I think that the array.length will correspond to the first number, on the Left Hand Side bracket. This is number of rows of element where each element is itself an array. Now, If we use the element.length, we can target the other bracket too.

> I am not sure if that is the answer you are lookig for.

I'm totally guessing here, but try array[n].length I think I read that the length of inner arrays can vary, so the above syntax seems like it could be correct...don't have a compiler here at work...and I'm new at Java, too


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us