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
How do you achieve singleton?
How to do encapsulation in java?
How do you reverse sort in java?
Is array size fixed in java?
What is the difference between @before and @beforeclass annotation?
How do you remove all elements from an arraylist in java?
Difference between predicate, supplier and consumer ?
What is arrays sort in java?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
What is the difference between java applets and applications?
What about method local inner classes or local inner classes in java?
Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?
What are synchronized methods ?
What is the use of math abs in java?
how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)