System.ICloneable Interface

Assembly: Mscorlib.dll
Namespace: System
Summary
Supports cloning, which creates a new instance of a class with the same value as an existing instance.
C# Syntax:
public interface ICloneable
Remarks
The ICloneable interface contains one member, ICloneable.Clone, which is intended to support cloning beyond that supplied by Object.MemberwiseClone.
See also:
System Namespace

System.ICloneable Member List:

Public Methods
Clone Creates a new object that is a copy of the current instance.

System.ICloneable Member Details

Method: Clone()
Summary
Creates a new object that is a copy of the current instance.
C# Syntax:
object Clone();
Return Value:
A new object that is a copy of this instance.
Remarks
ICloneable.Clone can be implemented either as a deep copy or a shallow copy. In a deep copy, all objects are duplicated; whereas, in a shallow copy, only the top-level objects are duplicated and the lower levels contain references.

The resulting clone must be of the same type as or a compatible type to the original instance.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.