Explain current thinking around IClonable.
Answer / madhunathanv
*-->ICloneable is to create the copy of type instances.
*-->To create a true copy of a reference type,
you must clone the object to which it refers.
*-->The ICloneable interface identifies a type as cloneable
and declares the Clone method as the
mechanism through which you obtain a clone of an object.
*-->The Clone method takes no arguments
and returns a System.Object, regardless of the implementing
type. This means that once you clone
an object, you must explicitly cast the clone to the
correct type.
*-->If your custom type contains reference-type data
members, you must decide whether your Clone method will
perform a shallow copy or a deep copy.
*--> A shallow copy means that any referencetype
data members in the clone will refer to the same objects as
the equivalent reference-type data
members in the original object.
*--> A deep copy means that you must create clones of the
entire object graph so that the reference-type data members
of the clone refer to physically independent copies
(clones) of the objects referenced by the original object.
Note:Mostly Shallow Copy is being Preferred.Because A
shallow copy is easy to implement by calling the
MemberwiseClone method from within your
Clone method.
System.Xml.XmlNode implements
a deep copy in its Clone method
| Is This Answer Correct ? | 4 Yes | 0 No |
What is the life cycle of an asp.net page?
What is the difference between visual basic and asp.net?
What are query strings used for?
What are the objects in used in ASP for processing input and outputs?
How do you validate the controls in an ASP .NET page?
If you are using two select queries and retrieving data. how do you access second query's result set using data reader?
1 Answers Cap Gemini, Keane India Ltd, MindSquare,
Explain difference between dataset and recordset?
What is asp.net architecture?
What is strong-typing versus weak-typing? Which is preferred? Why?
How can you access the properties and controls of master pages from content pages?
In asp.net 3.5 we can go one page to onther page without using statemanagment concept?
Why will you usually create an aspnet user account in the database for an asp.net web application?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)