[英]System.Object in C#, .NET
I don't really understand the second question, is my answer to the second question correct ? 我不太了解第二个问题, 我对第二个问题的回答正确吗?
My Answers : 我的答案 :
Clone() is not a method of System.Object. Clone()不是System.Object的方法。
ICloneable for Clone. 克隆可克隆。 System.Object is the root type, the rest of the methods are its direct members.
System.Object是根类型,其余方法是其直接成员。
What is the answer to the second question? 第二个问题的答案是什么? What does it mean?
这是什么意思?
Any advice would be very much appreciated. 任何建议将不胜感激。
Your answer to the first question is of course correct. 您对第一个问题的回答当然是正确的。 Proof .
证明 。
The second question means, that if you had interface IExtendedCloneable
which would derive from ICloneable
(had ICloneable
as parent interface), it would not be a corect answer, because ICloneable is more generic (less derived) - it is closer to object
on the inheritance tree. 第二个问题的意思是,如果您有接口
IExtendedCloneable
可以从ICloneable
派生(必须将ICloneable
作为父接口),那么这将不是一个核心的答案,因为ICloneable更通用(派生较少)-它更接近继承object
树。
If there wasn't that restriction, you could say that Clone()
is a member of System.Windows.Forms.Control.ControlCollection and you would be right, but the answer wouldn't be really relevant. 如果没有这个限制,您可以说
Clone()
是System.Windows.Forms.Control.ControlCollection的成员,那么您是正确的,但是答案实际上并不相关。
Thanks to that restriction, ICloneable
is the answer. 由于这一限制,
ICloneable
就是答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.