Export (0) Print
Expand All

Hashtable.Clone Method

Creates a shallow copy of the Hashtable.

[Visual Basic]
Public Overridable Function Clone() As Object Implements _
   ICloneable.Clone
[C#]
public virtual object Clone();
[C++]
public: virtual Object* Clone();
[JScript]
public function Clone() : Object;

Return Value

A shallow copy of the Hashtable.

Implements

ICloneable.Clone

Remarks

A shallow copy of a collection copies only the elements of the collection, whether they are reference types or value types, but it does not copy the objects that the references refer to. The references in the new collection point to the same objects that the references in the original collection point to.

In contrast, a deep copy of a collection copies the elements and everything directly or indirectly referenced by the elements.

The Hashtable clone has the same count, the same capacity, the same IHashCodeProvider implementation, and the same IComparer implementation as the original Hashtable.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Hashtable Class | Hashtable Members | System.Collections Namespace | CopyTo

Show:
© 2014 Microsoft