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
What are 4 pillers of object orinted programming?
Can we use string in switch case in java?
Is string an object?
How to sort array of 0 and 1 in java?
Explain list interface?
Are registers volatile?
Can an interface extend another interface?
What are the elements of java?
What is natural ordering in java?
What is the purpose of static keyword in java?
What is an interface in java?
You're given a Boolean 2D matrix, can you find the number of islands?
Can we use catch statement for checked exceptions?
what is bmg file and how to create that files?what will it contailn?
Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?