下面编译不过,哪位高手能给个合理解释?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
TParent = class
private
public
function ParentMethod: Boolean
virtual;
end;
TChild = class(TParent)
private
public
function ParentMethod: Boolean
override;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
{ TParent }
function TParent.ParentMethod: Boolean;
begin
Result := True;
end;
{ TChild }
function TChild.ParentMethod: Boolean;
begin
inherited;
end;
end.