What are the differences between a shallow clone of an object and a deep clone?
For instance, if you have an array of five elements, you have a total of six objects in memory, the array and the five elements. If you make a shallow copy, you have a total of seven objects in memory: the original array, the copied array, and the set of five elemenets that both arrays contain. For a deep copy, there would be a total of twelve elements since the five elements inside the array will be copied, too. Of course, if each of those elements contained even more objects, then the resulting set of objects would grow even larger.