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
Why does java have two ways to create child threads?
Can you explain the meaning of aggregation and composition
Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.
Can private method static?
how to deploy tomcatserver to weblogic server? write d following steps?
Can you add null to a list java?
What is meant by string is immutable?
Why synchronization is important?
Can we create our own daemon thread?
Differentiate between postfix and prefix operators in java.
Which number is denoted by leading zero in java?
What is the default value of an object reference declared as an instance variable?
What is string and its types?
What is an object class?
Where are global variables stored?