What is difference between clone and copyTo method?

Posted by Kumarkrishna184 under C# on 3/23/2018 | Points: 10 | Views : 947 | Status : [Member] | Replies : 4
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: Parth123 on: 4/1/2019 [Member] Starter | Points: 25

Up
0
Down
The Clone() methodology returns a brand new array object containing all the weather within the original array. This methodology creates a duplicate of associate array as associate object, thus has to be forged to the particular array sort before it may be accustomed do abundantly. The clone is of identical sort because the original Array.

The CopyTo() technique copies the weather into another existing array. It copies the weather of 1 array to a different pre-existing array ranging from a given index.

ASP.NET Software development companies
[url]https://www.ifourtechnolab.com/[/url]

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