Jump to content

Shallow copy

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Cheesy UK (talk | contribs) at 14:24, 21 March 2004 (Added intro as this appears to be the norm!). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computing, the result of shallow copying one object to another variable is two variables pointing to the same physical object in memory.

Thus changing the object pointed to by one of the variables will also cause the contents of the other variable to change (since the same object in memory is being altered).

Shallow copies are common when reference counting objects.

See also deep copy.