【发布时间】:2013-06-29 14:06:32
【问题描述】:
虚拟/动态的那个
// declare in Child Class
constructor Create; virtual;
constructor TChildClass.Create;
begin
inherited;
end;
具有覆盖的那个。
// declare in Child Class
constructor Create; override;
constructor TChildClass.Create;
begin
inherited;
end;
一无所有的人
// declare in Child Class
constructor Create;
constructor TChildClass.Create;
begin
inherited;
end;
这些是一样的吗?看起来很混乱。
【问题讨论】:
-
这个 Q 和构造函数有什么关系,还是和一般的 OOP 有关系?
-
其实只是想知道这个delphi例子的具体区别。
-
最好不要在问题中留下猜谜游戏。 “//声明”行是基类还是子类的那些部分?如果您在每种情况下都生成完整但最少的示例,那将是最好的。
-
是的,都是子类中的构造函数。
标签: delphi methods constructor virtual-functions