2011-02-13 37 views
0

可能重复的:
What is the difference between a deep copy and a shallow copy?请告诉我一个 “浅拷贝” 的对象

我看到这个今天在这里:http://msdn.microsoft.com/en-us/library/system.web.routing.route.aspx 和成员函数是一个:
“MemberwiseClone - 创建当前Object的浅表副本(从Object继承。)“
那么,什么是”浅拷贝“诗句...”深拷贝“?

+0

http://stackoverflow.com/questions/184710/what-is-the-difference-between-a-deep-copy-and-a-shallow-copy – ayush 2011-02-13 17:37:13

+0

@ayush谢谢,现在会删除问题 – Letseatlunch 2011-02-13 17:46:25

回答

0

浅拷贝只会替换对象当前级别的属性,这意味着如果您有一个对象作为属性,它将与原始对象具有相同的引用。如果你的属性当然是值类型或基元,这不是问题。