C#笔记~胡说胡记0.0.0.1

《illustrate c#2008》:

Inheritance allows you to define a new class that incorporates and extends an already declared class.

继承允许你定义一个新的类。这个新的类---包含并且扩展原来已经存在的类。

 

• You can use an existing class, called the base class, as the basis for a new class, called the
derived class. The members of the derived class consist of the following:
– The members in its own declaration
– The members of the base class

 

你能够使用一个已经存在的类,这个已经存在的类叫做基类。这个已经存在的类是新类的基础、基本。这个已经存在的类派生出一个新类,这个派生出来的新类叫做派生类。这个由已经存在的类也叫做基类派生出来的新类也就是派生类,里面的成员由以下组成:

---这个由已经存在的类也叫做基类派生出来的新类也就是派生类中,声明的成员

---这个由已经存在的类也叫做基类,的成员


• To declare a derived class, you add a class-base specification after the class name. The class-base specification consists of a colon, followed by the name of the class to be used as the base class. The derived class is said to directly inherit from the base class listed.

为了声明一个派生类,你加入一个基类的"specification”在类名字的后头。这个基类的"specification”其实一点也不神秘,它由一个“结肠”,并且followed by 类的名字,这个类的名字说穿了就是基类。“结肠”?也就是冒号。
• A derived class is said to extend its base class, because it includes the members of the base class plus any additional functionality provided in its own declaration.

一个派生类被说成是扩展了基类,原因就是派生类include基类的原来的成员,而且还包括额外的函数(这些都有老子我自己定义。)


• A derived class cannot delete any of the members it has inherited.

一个派生类不能删除基类的任何成员。

 

 

 For example, the following shows the declaration of a class called OtherClass, which is derived from a class called SomeClass:

例如:下面就shows了一个新类的声明,这个新类我们命令它的名字叫做"OtherClass",这个"OtherClass"是被派生于一个类,这个类叫做"SomeClass”:

                        Class-base specification
                               ↓
class OtherClass : SomeClass
{                       ↑        ↑
...                    Colon   Base class
}

 这个图可以看出,先前的Class-base specification他妈的就是 “: SomeClass” ,由大肠Colon+基类Base class组成。

 

 

 

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值