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?



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

Answer / 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

More C++ General Interview Questions

How many pointers are required to reverse a link list?

5 Answers   CTS,


How do you compile the source code with your compiler?

0 Answers  


What are the advantages of inheritance in c++?

0 Answers  


Given the following function definition: int doit(int &x, int y, int &z) { x = 3*x; y = y + 5; z = x+y; return z - 4; } int a = 5, b = 7, c = 9, d = 11; d = doit(a,b,c);

2 Answers  


Do vectors start at 0?

0 Answers  


What is c++ prototype?

0 Answers  


what is the diff b/n c and c++ a. dynamic scoping b. nested switching c. declaration of variables in any code block d. separation of compilation and linking

2 Answers   Hughes,


What is a modifier in c++?

0 Answers  


What is the return value of the insertion operator?

0 Answers  


What is function prototyping?

0 Answers  


To what does “event-driven” refer?

0 Answers  


Can you pass an array to a function in c++?

0 Answers  


Categories