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...

how can u apply shallow cloning and deep cloning to create
object?

Answer Posted / kiran sonaje

Hi,

Please refer below link for shallow cloning

http://www.java2s.com/Code/Java/Language-
Basics/ShallowCopyTest.htm

and for deep cloing
http://www.java2s.com/Code/Java/Language-
Basics/DeepCopyTest.htm

Please please observe clone method to get more
clarification between deep and shallow cloning

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you achieve singleton?

973


How to do encapsulation in java?

1049


How do you reverse sort in java?

941


Is array size fixed in java?

975


What is the difference between @before and @beforeclass annotation?

1103


How do you remove all elements from an arraylist in java?

1022


Difference between predicate, supplier and consumer ?

1052


What is arrays sort in java?

963


When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?

997


What is the difference between java applets and applications?

1151


What about method local inner classes or local inner classes in java?

1052


Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?

949


What are synchronized methods ?

1111


What is the use of math abs in java?

1006


how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)

2334