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

What is super class in c#?

0 Answers  


What is difference between dictionary and list in c#?

0 Answers  


What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?

0 Answers  


Does c# support try-catch-finally blocks?

0 Answers  


What is master page in asp net c#?

0 Answers  






can we drive a class from delegate?

4 Answers   InterGraph,


When would you use generics in your code c#?

0 Answers  


What?s a satellite assembly?

3 Answers   Visual Soft,


What is difference between dictionary and hashtable?

0 Answers  


What is the data provider name to connect to access database?

0 Answers  


What is the difference between CONST and READONLY?

0 Answers   BirlaSoft,


can you tell me what are the steps should follow to do delay signing.

1 Answers   HCL,


Categories