甚至对于没有声明 destructor(析构函数)的 derived classes(派生类)这也是成立的,因为,就像 Item 5 的解释,destructor(析构函数)是一个“如果你没有定义你自己的,编译器就会为你生成一个”的...
基于140个网页-相关网页
Constructing Derived Classes 派生类的构造
Common Syntax in Derived Classes 派生类的常用语法
in base and derived classes 在基类和派生类中
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.
新的派生类应该能够替换基础类而无需修改代码。
Second is the addition of the draw method on the BoxObject, which derived classes should use to do the drawing.
第二个是对BoxObject增加了draw方法,它的派生类应该用来进行制图。
应用推荐