深浅COPY之我所理解,望拍砖交流。

浅,深复制,有很大的区别。对引用类型的浅深复制基本上都会有很大的变化。浅复制,原引用对象值的变化,必然会引起浅COPY对象的变化。因为这是同一个引用,而对于深COPY来说,原有引用对象的变化,不会引起深COPY对原有对象引用的变化而变化,始终保持着最起初的COPY,非常的专一,忠贞。哈哈。
 
MemberWiseCopy是浅复制,主要是进行Clone(),浅复制主要是复制所有的对象,原有对象的值改变,浅复制的生成的对象一样一起改变。而深复制,只是复制了原对象的一个引用,原对象的值得改变,不会更改深复制对象的值改变,因为深复制,依然保存着对原对象的引用
shallowCopy and deepCopy is a very different each other.shallowCopy can copy the same object,while the object is changing and the shallowCopy is same changing too. But the Deep Copy is not so.DeepCopy can only copy the reference of the origin object.when it is changing,but not so
MSDN:
 
原文地址:https://www.cnblogs.com/wanzegui325/p/2249030.html