What is the difference between shallow copy and deep copy?

1 answer(s)
Answer # 1 #

A shallow copy shares references to any nested objects, so they are linked. A deep copy duplicates everything, creating a truly independent, separate clone.

[8 Day]