Mansukhdeep Thind wrote:So is it correct when I say that the method of class TreeSet results in a subset which is a "deep" copy of the respective elements of the original set? Any changes we make to one will be reflected in the other. Because as you explained about deep copy, this does confirm to that definition. Am I correct?
Mansukhdeep Thind wrote:OK. Could you perhaps provide me with a link where I can study these shallow and deep copy concepts in detail with examples for each?
Steve Higgins wrote:
thanks for the help guys but i still don't see the diff btwn for loop and arraycopy().
mean is there soemthing that can go wrong if i use for loop vs arraycopy()?
after a for loop executes an array copy, is array1 still pointing to array1 and array2 still pointing to array2?
after arraycopy() executes an array copy, is array1 still pointing to array1 and array2 still pointing to array2?
i guess i am trying to find a difference soemwhere that i can comprehend.
Steve Higgins wrote:me too. i think i need a visual drawing of wth is goign on.
Winston Gutkowski wrote:
The only way you can separate the two objects completely is by cloning them, and that is what is meant by a "deep" copy.
Jeff Verdegan wrote:I don't know if "clone" has a standard meaning of "deep copy" in CS in general, but the clone() method in the core API produces a shallow copy by default.