What?s the difference between the System.Array.CopyTo() and
System.Array.Clone()?
Answers were Sorted based on User's Feedback
Answer / rajesh
The Clone() method returns a new array (a shallow copy)
object containing all the elements in the original array.
The CopyTo() method copies the elements into another
existing array. Both perform a shallow copy. A shallow
copy means the contents (each array element) contains
references to the same object as the elements in the
original array. A deep copy (which neither of these
methods performs) would create a new instance of each
element's object, resulting in a different, yet identacle
object.
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / guest
The first one performs a deep copy of the array, the second
one is shallow
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / ranjanatyagi
the first one copy both the data and the structure i.e.
schema of the arry and the second one copy only the
structuere not data.
| Is This Answer Correct ? | 1 Yes | 4 No |
What is typeof c#?
How to exclude a property from xml serialization?
Explain what is the smallest unit of execution in .net?
Explain partial class in c#?
Can we assign null value to integer?
Explain About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use.
In gridview in editmode if we want to display information in one combobox based on
what are some characteristics of an array?
What is the difference between const and static read-only?
What is querystring in c#?
Why do we need interfaces?
what is .NET framework architecture ??
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)