在基类中定义类构造函数(即设置一些静态类变量)时,是否可以在派生类中重写此类构造函数,并从其层次结构父类中继承?
例:
TBaseclass = class(TObject) public class constructor ClassCreate; virtual; end; TOtherClass = class(TBaseClass) public class constructor ClassCreate; override; end; **implementation** class constructor TBaseClass.ClassCreate; begin //do some baseclass stuff end; class constructor TotherClass.ClassCreate; begin inherited; //do some other stuff end;