What is difference between clone and copyTo method?

Posted by Kumarkrishna184 under C# on 3/23/2018 | Points: 10 | Views : 1006 | Status : [Member] | Replies : 3
What is difference between clone and copyTo method?

Thanks and Regards,
Krishna Kumar



Responses

Posted by: Vedikaledange on: 1/4/2019 [Member] Starter | Points: 25

Up
0
Down
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 would create a new instance of each element's object, resulting in a different, yet identacle object.

DOT NET

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Liammasson33 on: 4/1/2019 [Member] Starter | Points: 25

Up
0
Down
Nice Post! I appreciate to you for this post. Really you are the best.

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response