Question: what is the difference between deep cloning and shallow cloning 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.