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 d difference between deep cloning and shallow
cloning in core java?

Answer Posted / laxmikanth

In Shallow Cloning, you can only create the replica of the
objects but not the objects it is holding. Assume your Car
class (car1) has car name and Engine obj reference (has a
relation). Then by Shallow clone you can create anothr Car
Object (car2)but the newly created object will have its own
car name but the Engine Obj reference of car2 will still
point to car1's Engine.

In Deep Cloning, you can create the complete replica of car1
object.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class have multiple subclasses?

1086


What is the difference between the reader/writer class hierarchy and the inputstream/outputstream class hierarchy in java programming?

1102


Explain the difference between static and dynamic binding in java?

1052


Why is logger singleton?

1093


What is difference between array and arraylist in java?

977


What is multithreading and its advantages?

1059


What does substring mean?

958


What is the main purpose of serialization in java?

1009


What is the use of arraylist in java?

1075


Is arraylist ordered?

1048


Can a vector contain heterogenous objects?

1046


Can we declare a constructor as final?

1287


What is a war file?

1058


Can you explain the cs option of java interpreter?

934


Can you declare an interface method static?

1040