HomeToolsAbout

Shallow vs Deep Copy

Shallow Copy

Shallow Copy stores the references of objects to the original memory address.

  • Reflects changes made to the new/copied object in the original object.

Stores the copy of the original object and points the references to the objects.

Deep Copy

Stores copies of the object’s value.

  • Doesn’t reflect changes made to the new/copied object in the original object.

Stores the copy of the original object and recursively copies the objects as well.

AboutContact