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

Can a list of string be stored within a two dimensional array?

1045


Difference between overloaded functions and overridden functions

1116


Explain pass by value and pass by reference.

1108


What is class invariant in c++?

1282


Is c++ high level programming language?

1186


Describe the process of creation and destruction of a derived class object?

1174


What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h

1111


How a new operator differs from the operator new?

1189


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

1065


Write about a nested class and mention its use?

1166


What is double in c++?

1118


What is a static element?

1138


How much do coding jobs pay?

1066


What is the use of data hiding?

1069


How do I run c++?

1125