I tried below example.
When i run the example I see output as below
After cloning, setting ce num to 5
After cloning, setting ce thing name to Barney
Notice that changing ce thing name to Barney changed ceShallowClone's thing name to Barney.
This is because the copy was shallow, and ce's thing and ceShallowClone's thing point to the same Thing.
Notice that ceDeepClone's thing name is Fred. This is because the deep copy resulted in ceDeepClone having its own Thing.
I have not clearly understood the output and difference between shallow and deep copy.
Any links resources ideas highly appreciated. Thanks in advance