Explain current thinking around IClonable.
Answer Posted / 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 |
Post New Answer View All Answers
What is http post action?
How do u optimize a query in asp.net?
What is web configuration file and how to use in web application
Which type if caching will be used if we want to cache the portion of a page instead of whole page?
Any one can tell how we store tiff format images in database and retrive from the database(need for tiff format only)
What are the data controls available in asp.net?
Can we have multiple worker process in an ASP.NET application? If so then how it has been handled by application? And who handles it?
What are the session management techniques asp net?
Explain the main function of razor in asp.net? : asp.net mvc
Why the javascript validation not run on the asp.net button but run successfully on the html button?
What are the features of asp net?
How would you implement inheritance using c#?
I want to connect a system in LAN and I want to access that. Whenever I am moving a mouse in my desktop, the similar thing has to happen in another system in which I have connected. I need coding for this in C# and ASP.NET Can anyone please help me. It is very urgent. Thanks in advance. My email id is manojkumarchallagundla@gmail.com Will you please?
Why select Web API?
What is the difference between runtime version and version?