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
What is the purpose of a constructor in c#?
What is encapsulation in csharp?
Why constructor is used in c#?
What is method and function in c#?
What is the difference between interface and abstract class in c#?
How assembly versioning in .NET prevent DLL Hell problem?
Where do we use static class in c#?
What do u mean by thread safe?
What is reflection c#?
Where do I put dll files?
What is the keyword used to prevent a class from being inherited by another class?
What is the components of window?
Why dictionary is used in c#?
What is multithreading with .net?
Can a struct inherit from an interface in c#?