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

Answer Posted / jiturcm

System.Array.CopyTo() performs deep copy and shallow.
Where as System.Array.clone() performs shallow copy.

System.Array.CopyTo() doesn't create new Array
System.Array.clone() create new Array of same length of existing array.

If System.Array.CopyTo()can perform both deep copy and
shallow then why System.Array.clone ?

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can scriptable objects have methods?

486


What do u mean by delegation?

530


Why to use “using” in c#?

548


What is difference between tostring() vs convert.tostring() vs (string) cast

534


Is 0 an unsigned integer?

489






What is a console application in c#?

439


What is difference between dictionary and hashtable in c#?

423


What is the function of .IsDescendent()?

573


What is difference between class and interface in c#?

448


Explain the difference between “system.array.clone()” and “system.array.copyto()” in c#?

503


If the original method is not static you can declare an override method to be static or not?

497


What is the difference between ref & out parameters in c#?

454


What is the use of tryparse in c#?

459


Is c sharp free?

534


What is Implicit conversion in C#?

557