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
In which order the constructor is called for an inherited class?
what is the difference between the debug class and trace class?
What are the different types of assemblies available and their purpose?
Is concurrent queue thread safe?
What is the difference between User controls and Custom Controls?
What is array and its types in c#?
What is call back method?
Why extension method is static?
Where do we use static class in c#?
What is the use of parse in c#?
User's session is explicitly killed by which method ?
Why var is used in c#?
Can you call from an inherited constructor to a specific base constructor if both base class and an inheriting class has a number of overloaded constructors?
Can struct be static in c#?
Can int be null c#?