posted 16 years ago
The array elements themselves will be the same, but the arrays are definitely decoupled - on a first level.
Consider the following:
So after clone() or System.arraycopy, both arrays have the exact same contents - that includes references to the exact same objects. If you overwrite a reference (like on line 9) that only changes one array. If you change an element of one array (like on line 11), you change the object to which both arrays are referencing, and therefore the contents of both arrays change. Not the references inside the array, but the objects these references refer to.