Do value types (Integer, Decimal, Boolean, etc…) inherit from Object?

前端 未结 8 2053
梦谈多话
梦谈多话 2020-12-03 14:59

Looking for clarification on this...

I\'ve heard that \'everything\' in .Net inherits from Object. I\'ve also heard that the difference between value types and refe

8条回答
  •  自闭症患者
    2020-12-03 15:18

    Yes, value types do inherit from Object.

    See the Inheritance Hierarchy section here: http://msdn.microsoft.com/en-us/library/system.valuetype.aspx

    The Remarks section in the same page says, literally:

    Both reference and value types are derived from the ultimate base class Object.

提交回复
热议问题