DEEP COPY v/s SHALLOW COPY
• A shallow copy means the contents contains references to the same as the elements in the original array
• A shallow copy collection copies only the elements of the collection, whether they are reference types or value types
• It DOES NOT copy the objects that references refer to
• The references in the new collection point to the same objects that the references in the original collections point to
• In contrast, a deep copy of a collection copies the elements and everything directly or indirectly referenced by the elements
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment