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

what is the order of initialization for data?

10 Answers   Amazon, TCS, Wipro,


How are the features of c++ different from c?

0 Answers  


How many keywords are used in c++?

0 Answers  


Why should you learn c++?

0 Answers  


What is the use of typedef?

0 Answers  


Do we have private destructors?

12 Answers   Symphony, TCS,


What is a loop? What are different types of loops in c++?

0 Answers  


What are virtual functions and what is its use?

1 Answers  


What is encapsulation in c++ with example?

0 Answers  


Give a very good method to count the number of ones in a "n" (e.g. 32) bit number.

3 Answers  


What is an Object/Instance?

1 Answers  


What is the output of the following 3D Array int arr[3][2][2]={1,2,3,4,5,6,7,8,9,10,11,12}; what is the output for arr[2][1][0]?

6 Answers   HCL, Integra, IPMC, ORG,


Categories