冰
冰冷的雨
Unregistered / Unconfirmed
GUEST, unregistred user!
有两个类如下:
(1)
TCustomLanNode = class(TObject)
private
FParent: TCustomLanNode;
FBrother: TCustomLanNode;
......
end.
(2)
TMyNode = class(TCustomNode)
在(2)中的FParent和FBrother应该是TMyNode,而不再是TCustomNode。
请问该如何写这两个类?
另外,我在(1)(2)里都要重载Create,是否在两个类的定义里都要用
constructor Create(AOwner: TComponent)
override;
或者(1)里用constructor Create(AOwner: TComponent);virtual
(2)里用constructor Create(AOwner: TComponent)
override;
(1)
TCustomLanNode = class(TObject)
private
FParent: TCustomLanNode;
FBrother: TCustomLanNode;
......
end.
(2)
TMyNode = class(TCustomNode)
在(2)中的FParent和FBrother应该是TMyNode,而不再是TCustomNode。
请问该如何写这两个类?
另外,我在(1)(2)里都要重载Create,是否在两个类的定义里都要用
constructor Create(AOwner: TComponent)
override;
或者(1)里用constructor Create(AOwner: TComponent);virtual
(2)里用constructor Create(AOwner: TComponent)
override;