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
Can you pass parameters to destructors?
Are enums static c#?
What is default value of bool in c#?
Define satellite assembly in c#?
Can interface inherit class in c#?
Explain the Different types of configuration files in .net?
What are the types of methods in c#?
What is the lock statement in c#?
What is the difference between an integer and int?
Can we inherit private class in c#?
How many bytes is a long c#?
What is a framework in c#?
How is exception handling implemented in c#?
Name some properties of array.
What is datatable in c#?