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

How do you declare a destructor in java?

1010


How do you check if a string is lexicographically in java?

962


How will you call an Applet using Java Script Function?

1044


How do you format in java?

1018


What are the advantages of passing this into a method instead of the current class object itself?

1678


What is the function of compareto in java?

1060


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

965


5 Coding best practices you learned in java?

1021


What are the principle concepts of oops?

967


What are the benefits of java?

1140


What’s meant by anonymous class?

1092


What type of value does sizeof return?

1016


How do you bind variables?

1114


What are new features introduced with java 8 ?

1001


Explain the available thread states in a high-level?

976