C
Cobra
Unregistered / Unconfirmed
GUEST, unregistred user!
要屏蔽父类的方法应该怎么做?
难道非要这样做吗?
TLink = class
protected
FHead:tpLink;
public
Property Head:tpLink Read FHead Default Nil;
Function Insert(Text:taLinkText):Boolean;
Function Delete(Index:integer;Text:String):Boolean;
procedure Free;
Function Search(Index:integer;Text:String):tpLink;
Function Count:integer;
end;
TStack = class(TLink)
private
Function Insert(Text:taLinkText):Boolean
Virtual
Abstract;
Function Delete(Index:integer;Text:String):Boolean
Virtual
Abstract;
public
Function Push(Text:taLinkText):Boolean;
Function Pop:taLinkText;
end;
还有,
Ta = class
procedure a;
end;
Tb = class(Ta)
procedure a;
end;
和这个有什么区别?
Ta = class
procedure a
virtual;
end;
Tb = class(Ta)
procedure a
override;
end;
难道非要这样做吗?
TLink = class
protected
FHead:tpLink;
public
Property Head:tpLink Read FHead Default Nil;
Function Insert(Text:taLinkText):Boolean;
Function Delete(Index:integer;Text:String):Boolean;
procedure Free;
Function Search(Index:integer;Text:String):tpLink;
Function Count:integer;
end;
TStack = class(TLink)
private
Function Insert(Text:taLinkText):Boolean
Virtual
Abstract;
Function Delete(Index:integer;Text:String):Boolean
Virtual
Abstract;
public
Function Push(Text:taLinkText):Boolean;
Function Pop:taLinkText;
end;
还有,
Ta = class
procedure a;
end;
Tb = class(Ta)
procedure a;
end;
和这个有什么区别?
Ta = class
procedure a
virtual;
end;
Tb = class(Ta)
procedure a
override;
end;