...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.
因为基类和衍生类拥有相同的接口,因此这个接口必须要有必要的实现。
Since both the base class and derived class have the same interface, there must be some implementation to go along with that interface.
应用推荐