Question: what is the difference between deep copy and shallow copy in java?
Answer: In shallow copy, only fields of primitive data type are copied while the objects references are not copied. Deep copy involves the copy of primitive data type as well as objet references.