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
Can a class have multiple subclasses?
What is the difference between the reader/writer class hierarchy and the inputstream/outputstream class hierarchy in java programming?
Explain the difference between static and dynamic binding in java?
Why is logger singleton?
What is difference between array and arraylist in java?
What is multithreading and its advantages?
What does substring mean?
What is the main purpose of serialization in java?
What is the use of arraylist in java?
Is arraylist ordered?
Can a vector contain heterogenous objects?
Can we declare a constructor as final?
What is a war file?
Can you explain the cs option of java interpreter?
Can you declare an interface method static?