为什么在注释的那一句中提示 method 'push' not found in base class(20分)

  • 主题发起人 主题发起人 huanzhugege
  • 开始时间 开始时间
H

huanzhugege

Unregistered / Unconfirmed
GUEST, unregistred user!
type
TStack = class(TObject)
private
m_iMaxSize: Integer;
m_iCurSize: Integer;
public
constructor Create(aSize:Integer)
virtual;
destructor Free
virtual;
function IsEmpty: Boolean;
procedure Clear;
function IsFull: Boolean;
procedure Push
overload
virtual
abstract;
function Pop: TObject
overload
virtual
abstract;
function GetTop: OLEVariant
overload
virtual
abstract;
end;

TOperandStack = class(TStack)
private
m_iContainer: array of Integer;
public
constructor Create(aSize:Integer)
override;
destructor Free
override;
procedure Push(aValue:LongInt)
reintroduce
overload
override;
//method 'push' not found in base class
function Pop: LongInt
reintroduce
overload
override;
function GetTop: LongInt
reintroduce
overload
override;
end;
为什么在注释的那一句中提示 method 'push' not found in base class
 
procedure Push(aValue:LongInt)
reintroduce
overload
override;过程与基类的 procedure Push
overload
virtual
abstract;定义不一样
所以override;不行。
提示 method 'push' not found in base class表示基类没有 'push' method
 
后退
顶部