Jump to content

Shallow copy: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Cheesy UK (talk | contribs)
m Added intro as this appears to be the norm!
Seth Ilys (talk | contribs)
m slight wikification
Line 1: Line 1:
In [[computing]], the result of shallow copying one object to another [[variable]] is two variables pointing to the same physical object in memory.
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).
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).
Line 5: Line 5:
Shallow copies are common when [[reference counting]] objects.
Shallow copies are common when [[reference counting]] objects.


See also [[deep copy]].
==See also==
* [[deep copy]]

{{msg:stub}}

Revision as of 14:34, 21 March 2004

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