What’s the difference between the System.Array.CopyTo() and System.Array.Clone() ?
August 11, 2010 by bigboss · Leave a Comment
Filed under: C Sharp C# Interview Questions, Sample Interview Questions
Filed under: C Sharp C# Interview Questions, Sample Interview Questions
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 (which neither of these methods performs) would create a new instance of each element’s object, resulting in a different, yet identacle object.
Describe the accessibility modifier “protected internal”.
It is available to classes that are within the same assembly and derived from the specified base class.
