What?s the difference between the System.Array.CopyTo() and
System.Array.Clone()?

Answers were Sorted based on User's Feedback



What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?..

Answer / 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

What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?..

Answer / guest

The first one performs a deep copy of the array, the second
one is shallow

Is This Answer Correct ?    0 Yes 3 No

What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?..

Answer / ranjanatyagi

the first one copy both the data and the structure i.e.
schema of the arry and the second one copy only the
structuere not data.

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More C Sharp Interview Questions

How can you overload a method?

3 Answers  


What are PE(Portable Executable)?

0 Answers   MCN Solutions,


What is a system lock?

1 Answers   AZTEC, Wipro,


can any one send the project manager questions in .net

1 Answers  


How do I simulate optional parameters to com calls?

0 Answers  






How to transpose multi-dimensional array?

0 Answers   C DAC, CDAC,


Do vs while c#?

0 Answers  


Where test director stores its data ? Database ,Local file etc...? I need to read this data from Visual Studio 2005 c# client. Regards

0 Answers  


What is a console in c#?

0 Answers  


How does inheritance work in c#?

0 Answers  


What does Dispose method do with the connection object?

2 Answers  


Why delegates are required?

0 Answers  


Categories