Answer Posted / mario j vargas
You can perform a deep copy in C# by implementing the
ICloneable interface and manually assigning the values of
each member field in the current instance to the new
instance being returned. It is important to mention in the
implementation's documentation whether or not the copy is a
shallow or deep copy.
Bhagyesh suggested using a copy constructor. This is
something I had never seen in C#, only in C++, but the idea
sounded very compelling and I think this could be another
way to achieve a deep copy. You should check out the article
"How to: Write a Copy Constructor (C# Programming Guide)" in
the MSDN documentation.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Explain the difference between web user control and web custom control?
Which validator control you use if you need to make sure the values in two different controls matched?
What is meant by web application?
What is the page life cycle in asp.net?
Explain the difference between Web Garden and Web Farm?
What is preprocessor in .net?
How is the asp.net mvc architecture different from others? : asp.net mvc
Explain what the contents of cookie?
What is difference between view and partial view?
How tooltip is set through code-behind in ASP.NET?
Give a few examples of page life cycle events.
When you are running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?
Explain the code Access Security (CAS) in .net Framework?
What are the different methods of session maintenance in asp.net?
How u refer webservices?