In Java, what is a shallow copy?

A shallow copy just copies the values of the references in the class. A deep copy copies the values. given: In this case the shallow copy has the same reference (==) and the deep copy only has an equivalent reference (.equals()). If a change is made to the value of a shallowly copied reference, then … Read more