In the previous section, we made use of an interesting member function, present on all .NET objects: MemberwiseClone
. This method is a source of great confusion in the developer community. Don't be fooled by its name -- it's certainly not any kind of alternative to ICloneable.Clone
, because it's a protected method. Furthermore, it's not even overrideable by derived types, because it's not a virtual method. Its only purpose in life seems to be to assist us in our implementations of Clone
methods, by performing the default .NET shallow-copy in just one line of code.
转载于:https://www.cnblogs.com/xiaoyuer323/archive/2005/08/27/224347.html