Explain the difference between “System.Array.Clone()” and “System.Array.CopyTo()” in C#?
S.no | System.Array.Clone() | System.Array.CopyTo() |
---|---|---|
1. | Used for creating a new array containing elements of the original array | Elements of existing array get copied into another existing array. |
2. | Does not require a destination array to exist | Destination array must exist |
BY Best Interview Question ON 14 Feb 2019