Originally posted by John Blutarsky:
In Sierra & Bates at chapter I page 44 there is:
"If you assign an array to prevoiusly declared array reference, the array you're assigning must be the same dimension as the reference you're assigning it to"
but this:
...
int[] a1 = new int[5];
int[] a2 = new int[6];
a1 = a2;
...
compile fine. Why?
Sure,
1 Dimension can assigned to 1 Dimension.
a1 and a2 are same type that can be assigned.
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand