基类的派生类,类型的仿制药。网。
你可以指定基类的派生类。
新的派生类应该能够替换基础类而无需修改代码。
The new derived classes should be able to replace the base classes without any change in the code.
在用于以后的派生类时,这将取消成员的虚效果。
This negates the virtual aspect of the member for any further derived class.
我有一个基类。我怎么叫正确的派生类的正确方法?
I have a base class. How do I call the right method for the right derived class?
创建一个从预定义grammar类继承而来的派生类。
Create a derived class inherited from the predefined grammar class.
在这一点上,你会希望你的对话框栏连接到您的派生类。
At this point, you will want to link your dialog bar to your derived class.
在这一点上,你会希望你的对话框栏连接到您的派生类。
除了在已重写和实现此方法的派生类中以外,用户不需要调用此方法。
This method does not need to be called by users, except in derived classes where this method has been overridden and implemented.
除了作为抽象类的派生类对象的一部分,是不能够生成抽象基类对象的。
We may not create objects of an abstract type except as parts of objects of classes derived from the abstract base.
如果事件处理程序需要状态信息,则必须创建此类的派生类来保存数据。
If the event handler requires state information, you must create a derived class from this class to hold the data.
第二个是对BoxObject增加了draw方法,它的派生类应该用来进行制图。
Second is the addition of the draw method on the BoxObject, which derived classes should use to do the drawing.
如果引入新的派生类时,需要修改基类代码,那么这就不是一个好的设计。
Any design that requires code changes to handle the introduction of a newly derived class is a bad design.
如果您的派生类有专用样式选择器或缓存样式值,则可以包含重写此方法的方案。
Scenarios for overriding this method might include if your derived class has a specialized style selector, or caches style values.
我只是向Person引入了一个新的派生类,这个类和目前涉及到的其他类都在同一个包中。
I just introduce a new derived class to Person, which is of the same package as the other classes thus far. Not surprisingly, I'll call this class Employee, shown in Listing 2.
您设计的派生类必须有一个名为definition(可以不修改此名)的嵌套的模板类/结构。
The derived class that you design must have a nested template class/structure named definition (you may not change this name). The definition class has the following properties
如果你在一个面向对象设计中发现了多重继承关系,确保没有哪个基类实际上是另一个基类的派生类。
Whenever you have found a multiple inheritance relationship in an object-oriented design, be sure that no base class is actually a derived class of another base class.
当具有基类的引用或指针,但需要执行不是基类组成部分的派生类操作的时候,需要动态的强制类型转换。
Dynamic casts are needed when we have a reference or pointer to a base class but need to perform operations from the derived class that are not part of the base class.
类似TextSplitter的类(或其未来的派生类)往往会包含针对许多具体派生类的有用功能。
A class like TextSplitter (or its future descendents) might contain a bit of functionality that might be useful for a number of concrete descendents.
抽象类的另一个用途是为多个派生类创建一个基类,在这些派生类中,基类决不会被实例化。
Another use of abstract classes is to create a single base class for multiple derived classes in which that base class should never be instantiated.
派生类的大小等于基类加上派生实例定义的其他成员(以及对齐所必需的任何额外空间 —如前所述)的大小。
The size of a derived class is the size of the base class plus the additional members defined by a derived instance (and any extra space required for alignment, as discussed earlier).
另外,绑定派生类不会专门化其从其它地方继承的方法。
In addition, binding descendent classes does not specialize their methods that are inherited from elsewhere.
派生类具有跟基类相同的动态类属性。
The derived classes have the same dynamic class attributes of the base class.
派生类可以指明它实现了其基类的接口,但是并不是一定要这么做。
Derived classes are not required to re-state that they implement an interface from their base class, but are permitted to do so. (This case is special; see below for more details.)
此类的run方法是final类型,因此派生类不能使用它指定自己的逻辑。
The run method on this class is final so that derived classes cannot use it to specify their logic. Instead, you should override the following method so that it contains the logic for the thread.
它是可能的(部分)实现抽象方法,仍然需要派生类也要实现它?
Is it possible to (partially) implement an abstract method and still require derived classes to also implement it?
所有的通过基类实现的接口是由其派生类继承。不可序列化的。
All interfaces implemented by base classes are inherited by their derived classes. Not just Serializable.
在派生类中重写时,将编码器设置回它的初始状态。
When overridden in a derived class, sets the encoder back to its initial state.
在派生类中重写时,将编码器设置回它的初始状态。
When overridden in a derived class, sets the encoder back to its initial state.
应用推荐