Chris Smith said:
Tony Morris said:
Remember that a so-
called "two-dimensional array" is really nothing but an array whose
elements are arrays.
Not quite.
A 2-dimensional array is one that has 2 dimensions e.g. in C#, a int[,] is a
2-dimensional array; and in COBOL, a TABLE is a 2-dimensional array.
Java has no 2 dimensional arrays (despites false claims, even by the JLS
itself); it only has arrays of arbitrary type - they are not synonymous.
I'm not sure what distinction you're trying to make. As near as I can
tell, what you said is exactly identical to what I said. Yet you say
you don't agree with me. Can you clarify?
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
I can't see the ambiguity, but yourself and Patricia suggest there is one,
so I'll try to rephrase.
"A 2-dimensional array is one that has 2 dimensions e.g. in C#, a int[,] is
a
2-dimensional array; and in COBOL, a TABLE is a 2-dimensional array."
I think we all agree with this.
"two-dimensional array is really nothing but an array whose elements are
arrays."
This is the part that is not true.
A two-dimensional array is certainly not an array of arrays and vice versa.
They are not synonymous; the only real relationship is that one may
conceptualise each in a similiar fashion.
C# allows both "arrays of arrays" as Java does, as well as multi-dimensional
arrays.
COBOL has always had the TABLE construct, which is a multi-dimensional
array.
Java has no multi-dimensional arrays, only arrays of arbitrary type (which
might be an array or an array of arrays, etc.). The JLS (or was it the
tutorial - which contains just as many flaws as the JLS?) makes mention of
"multi-dimensional arrays in Java" - the truth is, they simply don't exist.
Hope this makes sense.