首页 > 其他 > 详细

06-01 The Basic Mechanics of Inheritance

时间:2015-02-15 11:53:28      阅读:372      评论:0      收藏:0      [点我收藏+]

The existing class that will serve as the basis for the new class is termed a base or parent class.

那些用于服务新的的已经存在的类被称为基类或者父类。

The extending classes are formally termed derived or child classes.

扩展类被称为继承类或者子类。

Although constructors are typically defined as public, a derived class never inherits the constructors of a parent class. 

虽然构造函数被定义魏公共的,继承类从来不继承父类的构造函数。

Remember, private members can only be accessed by the class that defines it. 

Speaking of base classes, it is important to keep in mind that C# demands that a given class have exactly one direct base class. It is not possible to create a class type that directly derives from two or more base classes 

C# supplies another keyword, sealed, that prevents inheritance from occurring.

C#提供了另一个关键字,sealed防止继承的发生。

 Therefore, you can never derive one structure from another structure, a class from a structure, or a structure from a class.

---------------------------------------------------------------------------------------------------------------------------------------

06-01 The Basic Mechanics of Inheritance

原文:http://www.cnblogs.com/cout/p/4292591.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!