What?s the difference between the System.Array.CopyTo() and
System.Array.Clone()?
Answer Posted / sree..
The below code does a deep copy.
Let me know if something is wrong with the code.
string[] array = new string[1] { "aaa" };
string[] copy = new string[1];
array.CopyTo(copy, 0);
copy[0] = "xyz";
Console.WriteLine(array[0]);
I see array[0] value as "aaa".
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is a multicast c# delegate?
Explain publishers and subscribers in events.
What are controls in c#?
Can enum be null c#?
What do you mean by thread safe in c#?
What is arraylist c#?
Explain how do you directly call a native function exported from a dll?
What are the 3 types of comments in c#?
What is the purpose of constructor in c#?
What is the difference between virtual method and abstract method?
Why do we need generics in c#?
Where do we set the min and max pool size for connection pooling?
What are classes in c#?
Why do we use public static void main in c#?
Explain the types of assemblies in .net?