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

How would you call C functions from C++ and vice versa?

1174


Which one is better- macro or function?

1201


Are there interfaces in c++?

1018


What is #include cstdlib in c++?

1188


What is ostream in c++?

1015


What is the basic structure of c++ program?

1102


Write about the members that a derived class can add?

975


What does it mean to declare a member variable as static?

1060


What is microsoft c++ redistributable 2013?

1106


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

1082


What is atoi?

974


What is a c++ class?

1101


Why are arrays usually processed with for loop?

1237


How to declare a pointer to an array of integers?

1144


Can we change the basic meaning of an operator in c++?

1114