Loading…

How we can make copy of a java object?

For copying an object in Java, there are two ways- shallow copy and deep copy.

  Shallow Copy Deep Copy
1. When you want to copy only field values All the objects are deeply copied
2. Copy is dependant on original object Copy is not dependent on earlier objects

Suggest An Answer

No suggestions avaliable!

Latest post from Java interview questions

Ask Question