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
In which event of page cycle is the viewstate available?
Explain security types in asp.net?
How can you implement encapsulation in asp.net?
Explain the use of dataadapter.
What are the different types of Caching techniques in ASP.NET?
What are url fragments?
What does session_start () do?
What are the different types of cookies in asp.net?
Elaborate differentiation between Cache and Application?
What is meant by server side scripting?
How can you handle unmanaged code exceptions in asp.net?
Define common type system?
What’s the use of “GLOBAL.ASAX” file?
Can we use a static function with a non-static variable?
What is authorization in asp.net?