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...

What is difference between shallow copy and deep copy? Which is default?

Answer Posted / hrpynux@gmail.com

Default version of clone method creates the shallow copy of an object. To create the deep copy of an object, you have to override clone method. Shallow copy is preferred if an object has only primitive fields. Deep copy is preferred if an object has references to other objects as fields.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are 2 ways of exporting a function from a dll?

1198


Do the names of parameters have to agree in the prototype, definition, and call to the function?

1031


Explain operator overloading.

1062


Refer to a name of class or function that is defined within a namespace?

1119


What is difference between class and function?

1089


What is new in c++?

1100


What does int * mean in c++?

1231


Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

1249


Which operations are permitted on pointers?

998


Can we distribute function templates and class templates in object libraries?

1081


What is the full form of ios?

1070


What is the use of function pointer?

1027


Define basic type of variable used for a different condition in C++?

1132


What is a type library?

1109


Does a derived class inherit or doesn't inherit?

1091