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
Is equal in c#?
Explain the difference between the system.array.copyto() and system.array.clone()?
What are collection classes?
What does namespace mean?
What is boxing and unboxing in c#?
What are actions in c#?
How do you specify a custom attribute for the entire assembly?
Is datetime a value type in c#?
how to stored and retrive video in Sql server using asp.net c#......?
What is single dimensional array in c#?
Are attributes inherited c#?
Is c# dictionary a hash table?
What is assembly version series sequence?
What do you mean by serialization in .NET?
What is dbcontext c#?