Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How to implement cloning in .NET ? What is shallow copy and deep copy
How do you implement prototype pattern in .NET?
✍: Guest
Cloning is achieved by using ICloneable of the System namespace. It has a “Clone” method which actually returns the reference of the same copy. Clone method allows a Shallow copy and not a deep copy. In Shallow copy if you make changes to the cloned object it actually changes on the main object itself. So how is deep copy achieved, by using “ISerializable” interface? So what you do is first serialize the object then deserialize back to a complete new copy. Now any changes to this new copy do not reflect on the original copy of the object, this is called as Deep copy.
2007-10-24, 5797👍, 0💬
Popular Posts:
What is application domain? Explain. An application domain is the CLR equivalent of an operation sys...
What is the difference between const char* p and char const* p? In const char* p, the character poin...
Can you prevent a class from overriding ? If you define a class as “Sealed” in C# and “NotInheritab...
How To Create an Add-to-Netvibes Button on Your Website? - RSS FAQs - Adding Your Feeds to RSS News ...
How do we create DCOM object in VB6? Using the CreateObject method you can create a DCOM object. You...