...Parent class)或“基 础类”(Base class),而继 承父类的类就称之为“子类” (Child class)或“衍生类” (Derived class),在继承时 您使用"extends" 关键字,并 指定要被继承的类。
基于40个网页-相关网页
结果是你可以用衍生类的对象替代基类的对象。
As a result, you can exactly substitute an object of the derived class for an object of the base class.
经常在设计过程中,你想要基础类只把接口提供给衍生类。
Often in a design, you want the base class to present only an interface for its derived classes.
但是你也会发现有时候你很明显的必须去给衍生类增加新的方法。
But you'll find that there are times when it's equally clear that you must add new functions to the interface of a derived class.
应用推荐