文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C#胡说胡记0.0.0.3

C#胡说胡记0.0.0.3

时间:2010-08-22  来源:菜刀大侠

《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个等价的类声明:

 

相关阅读 更多 +
排行榜 更多 +
终极街头格斗

终极街头格斗

休闲益智 下载
大炮轰飞机

大炮轰飞机

飞行射击 下载
像素打僵尸

像素打僵尸

飞行射击 下载