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
Where static variables are stored?
Why main method is static in c#?
What is serialization in unity?
What are the different states of a thread?
Explain streamreader/streamwriter class?
is it possible to access a remote web service Without UDDI?
How do you sort a list in c#?
What is ienumerable and iqueryable?
What is func c#?
What is string method in c#?
Why do we use Design Pattern in C#?
Which is better interface or abstract class in c#?
What is dependency injection?
What are verbatim strings in c#?
Is a valid int value?