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's the difference between a static method and a non static method c#?
From which base class do all Web Forms inherit from?
What are extender provider components? Explain how to use an extender provider in the project.
What is datatable in c#?
What is using directive in c#?
What is the purpose of ienumerable in c#?
Is class reference type c#?
What is the difference between properties and indexer in c#?
what are windows services?
What is desktop GUI application?
Is struct object oriented?
What is void in c#?
What is a singleton unity?
What is singleordefault c#?
What is a value type in c#?