C#胡说胡记0.0.0.3

《illustrate c# 2008》:

All Classes Are Derived from Class object
所有的类来自于类object

All classes, except special class object, are derived classes, even if they don’t have a class-base specification. Class object is the only one that is not derived, since it is the base of the inheritance hierarchy.

 

所有的类,除了类object,都是派生类,即使后面没有 ":SomeClass”之类的"class-base specification".类object,是唯一一个类,这个唯一体现在他不是被派生的,他就是他,因为他是所有继承层次结构的基础。
Classes without a class-base specification are implicitly derived directly from class object.Leaving off the class-base specification is just shorthand for specifying that object is the base class. The two forms are semantically equivalent. Figure 7-2 shows both forms of declaration for the same class.

 一个类后面没有 ":SomeClass”之类的"class-base specification",这个类也是继承类,为什么,因为他implicitly继承于类object。离开了"class-base specification"也就是没有"class-base specification"的类,仅仅是以object类为基类的"shorthand"(简写),下面就来说明这个问题,图7-2显示了2个等价的类声明:

2010082201500334.png

 

转载于:https://www.cnblogs.com/caidaodaxia/archive/2010/08/22/1805638.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值