Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain about solution explorer window?

1037


What is difference between asp.net and asp?

1048


How to store checkbox value in database in asp.net mvc? : Asp.Net MVC

980


Can a master page have more than one contentplaceholder?

968


What is distributed system in asp.net?

1032


Explain the different parts that constitute ASP.NET application?

1017


What is autopostback true?

1068


Explain the difference between asp and asp.net?

1012


What is the difference between a cookie and a pixel?

936


Explain program to call the js function when the change is being made in the dropdown list made in asp.net mvc? : asp.net mvc

994


How can we inherit a static member?

1071


Which methods validate all the controls on a page?

977


What are the session variables?

982


What are the types of session in asp.net?

967


Explain serialization and deserialization?

1026