Only fields with primitive data types are transferred in a shallow copy; references to objects are not copied. Deep copy involves both the copying of object references and primitive data types. When to use shallow copy and when to use deep copy has no set, unbending rules.
Vishalini.R Answered question September 7, 2023