Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

ArrayList.Clone Method

Creates a shallow copy of the ArrayList.

[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 ArrayList.

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.

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

ArrayList Class | ArrayList Members | System.Collections Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.