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 difference between method and function in c#?
What is difference between private and protected in c#?
Example of value type and refarnce type
Difference between debug.write and trace.write?
What is a collection in c#?
What does out mean in c#?
Why do we use public static void main in c#?
how to handle errors in sqlserver
Name some properties of array.
What is a factory in c#?
Hi to everybody. Lastweek i had taken an interview on c#. They ask what is boxing & unboxing, Masking.Please tell the answer and it is useful for me.
what is work of continue statement in C#?
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)