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 Available!