What?s the difference between the System.Array.CopyTo() and
System.Array.Clone()?
Answer Posted / 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 |
Post New Answer View All Answers
Name the method of servicebase class?
Is int a class in c#?
What is the difference between ienumerable and icollection?
What is action in c# 3.5?
Explain what is the smallest unit of execution in .net?
What is difference between override and new in c#?
What is the difference between c and c# programming?
How to put assembly in gac?
Why do we need generics?
What is inheritance c#?
What is the difference between integer and double?
What are the applications of c#?
Define method overloading in c#?
What is the difference between class and namespace?
Which sorting algorithm is best?