shallow copy and deep copy :(

Hi all,

I am confused with the concepts of shallow copy and deep copy.
Any one here please tell me the difference between the two.


Nishu
If you have one object (A) that contains a reference to one or more other objects ({B}), a shallow copy of A is another object that contains a reference to the same {B}. In this case there exists only one copy of {B}.

A deep copy on the other hand is a copy of A that contains a reference to a copy of {B}. In this case there exists two copies of {B}.

See the difference?
Topic archived. No new replies allowed.