Saturday, January 4, 2014

What is the difference between a deep copy and a shallow copy?

There are two kinds of object copying:  shallow copies and deep copies.

The normal copy is a shallow copy that produces a new collection that shares ownership of the objects with the original.

Deep copies create new objects from the originals and add those to the new collection.

 

No comments:

Post a Comment