ICloneable.Clone Method

Creates a new instance (object) that is a copy of the current object.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

public Object Clone ()

Return Value

A new object that is a copy of the current object.

Remarks

You can use the Clone to create either a deep copy or a shallow copy of a specific object. In a deep copy, all elements are duplicated. In a shallow copy, only the top-level elements are duplicated, whereas the lower-level elements contain references.

An object created by cloning must be of the same type as or a type compatible with the original object.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

ICloneable Interface
ICloneable Members
System Namespace