Whats a "shallow copy" of an objects [duplicate]
Possible Duplicate:
What is the difference between a deep copy and a shallow copy?
I saw this today here: http://msdn.microsoft.com/en-us/library/system.web.routing.route.aspx and one of the member functions was:
"MemberwiseClone - Creates a shallow copy of the current Object. (Inherited from Object.)" So whats a "shallow copy" verse a ... "Deep copy"?Shallow copy only replaces the properties on the current level of the object, that means if you have an object as a property it will have the same reference as your original. This is not a problem if your properties are value types or primitives of course.
精彩评论