当您在基类中定义类构造函数(即设置一些静态类变量)时,是否可以在派生类中覆盖该类构造函数并从其继承的层次父级调用构造函数?
例子:
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;