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

Explain rtti.

1136


What are multiple inheritances (virtual inheritance)?

1113


How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?

1127


Which one is better- macro or function?

1278


What are the advantages of c++ over c?

1134


What is the difference between strcpy() and strncpy()?

1192


How does atoi function work?

1178


Explain object slicing in c++?

1122


What is difference between rand () and srand ()?

1149


Define a constructor - what it is and how it might be called (2 methods)?

1225


What is the use of ::(scope resolution operator)?

1123


Explain the uses of static class data?

1158


When does a 'this' pointer get created?

1149


Explain how overloading takes place in c++?

1092


What is == in programming?

1089