Peter Taucher wrote:On the first hierarchy you loop over arrays of objects (not object). Take a look:
Ok, I get it. In the outer loop "r" actually becomes an array for the row, then in the inner loop the "c" becomes the individual cell within the row. Out of curiosity, if there are three dimensions to the array, would this be the code:
Seetharaman Venkatasamy wrote:better to say *array of arrays* insteadof multidimensional . your for loop declaration is wrong .
Sorry, multi-dimensional is how I've always seen nested arrays referred to. I'm guessing "array of arrays" is a java term. I'll try to remember this in the future.
Mike Lipay wrote:Ok, I get it. In the outer loop "r" actually becomes an array for the row, then in the inner loop the "c" becomes the individual cell within the row. Out of curiosity, if there are three dimensions to the array, would this be the code:
Not exactly. I'd say it has to look like this:
Censorship is the younger of two shameful sisters, the older one bears the name inquisition. -- Johann Nepomuk Nestroy
Java arrays are not multi-dimensional but arrays of arrays. If they were multi-dimensional, the individual members would have to be the same size, which is not the case in Java. Arrays of arrays may also allow different placement of the data in memory, re-assignment of members, etc.
Mike Lipay wrote:Ok, I get it. In the outer loop "r" actually becomes an array for the row, then in the inner loop the "c" becomes the individual cell within the row. Out of curiosity, if there are three dimensions to the array, would this be the code:
Not exactly. I'd say it has to look like this:
with the multidimensionality of the array of arrays ... i guess i am quoting write
the outermost for loop argument contains the most significant array of the arrays and with each inner loop argument containing the less significant one than the previous one