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

Is as operator in c#?

471


What is a method c#?

473


What is _layout cshtml?

486


How to properly clean up excel interop objects?

506


What are c# attributes and its significance?

525






What is session management in c#?

529


Do void methods have parameters?

496


What is the advantage of extension method in c#?

466


Describe the ways of cleaning up objects in c#.

522


Explain the difference between a struct and a class?

508


What is default access specifier for class in c#?

475


What is difference between internal and protected internal in c#?

466


How will you get the different language strings?

507


Is datetime nullable c#?

506


Why do we need a singleton class?

508