1
JavaAdvanced#oop#interface
A shallow copy duplicates an object's fields but for reference-type fields, copies only the reference (both objects share the same nested object). A deep copy recursively duplicates nested objects too, so the copies are fully independent.
class Person implements Cloneable {
List<String> hobbies;
public Person clone() {
// shallow: shares hobbies list
// deep would need: new ArrayList<>(hobbies)
}
}