Shallow Copy Vs Deep Copy
In short: A shallow copy duplicates only the top-level fields of an object. If the object holds a handle to another object, the copy shares that same inner object, so changing it through one handle affects both. A deep copy duplicates the top-level fields and also builds fresh copies of every nested object, so the…
