Thursday, March 20, 2008

When is a clone not a clone? When it's half a clone!

After finding that the clone of a two-dimensional array in Java seems to not be a clone, I searched the web, already strongly suspecting the outcome.

Behold (from one of Sun's references):
A clone of a multidimensional array is shallow, which is to say that it creates only a single new array. Subarrays are shared.
Then that's hardly a clone now is it? Damn you AvatarJava. Daaammmnnnnn youuuu!

No comments:

Post a Comment