利用继承机制,新的类可以从已有的类中派生。那些用于派生的类称为这些特别派生出的类的“基类”。
派生类具有跟基类相同的动态类属性。
The derived classes have the same dynamic class attributes of the base class.
新的派生类应该能够替换基础类而无需修改代码。
The new derived classes should be able to replace the base classes without any change in the code.
创建一个从预定义grammar类继承而来的派生类。
Create a derived class inherited from the predefined grammar class.
应用推荐