A shallow copy is a source object that is shared with a copy object, and only refers to a variable (with a different name). A shallow copy is a pointer copy, and a change to any of these objects affects another object.
For example, a person at the beginning of the call Zhang San, later renamed John Doe, but still the same person, whether it is Zhang three missing arms or legs or Li four short legs, is this person unlucky.
deep copy means that the source object and the Copy object are independent of each other, and the deep copy copies the contents of the pointer to the pointer copy, and no change of any object will affect the other object.
For example, a person named Zhang San, later with his cloning (assuming the law allows) another person, called John Doe, whether it is Zhang three short arms or legs or Li four lack of arms and legs will not affect another person. A typical value object, such as a predefined type Int32,Double, and struct (struct), enumeration (enum), andso on.
What is the difference between a deep copy and a shallow copy?