posted 20 years ago
a1 refers to a 1 dimensional array, type A11[], of one component containing a reference of type A11 to the one and only instance of a class A11 object.
a2 is a 2 dimensional array, type A11[][], with two rows. Each row is that same one dimensional array referred to by a1.
a3 is a 3 dimensional array, type A11[][][], with 3 slices. Each slice is that same 2 dimensional array referred to by a2.
so a3's maximum subscripts are a3[2][1][0]
a2 actually refers to a 1 dimensional array of 2 references of type A11[].
Both references are set to the same value by copying the value of a1.
a3 actually refers to a 1 dimensional array of 3 references of type A11[][]. All 3 references are set to the same value by copying the value of a2.
The output is "A11".
[ December 15, 2004: Message edited by: Mike Gershman ]
[ December 15, 2004: Message edited by: Mike Gershman ]
Mike Gershman
SCJP 1.4, SCWCD in process