G
gulang
Unregistered / Unconfirmed
GUEST, unregistred user!
老给别人回答,这次我也出个问题。知道答案的高手先别记着说,让大家先讨论讨论[]
type
Tperson=class
public
procedure draw();virtual;
end;
Tman=class(Tperson)
public
procedure draw();overload;
end;
Twoman=class(Tperson)
public
procedure draw();override;
end;
Tform1=class(Tform)
public
a:Tman;
b:Twoman;
end;
procedure Tperson.draw();
begin
showmessage('person');
end;
procedure Twoman.draw();
begin
showmessage('woman');
end;
procedure Tman.draw();
begin
showmessage('man');
end;
[red]procedure TForm1.Button1Click(Sender: TObject);
begin
a.draw;
b.draw
end
[/red]
button1Click执行有问题吗?有什么问题?为什么?
type
Tperson=class
public
procedure draw();virtual;
end;
Tman=class(Tperson)
public
procedure draw();overload;
end;
Twoman=class(Tperson)
public
procedure draw();override;
end;
Tform1=class(Tform)
public
a:Tman;
b:Twoman;
end;
procedure Tperson.draw();
begin
showmessage('person');
end;
procedure Twoman.draw();
begin
showmessage('woman');
end;
procedure Tman.draw();
begin
showmessage('man');
end;
[red]procedure TForm1.Button1Click(Sender: TObject);
begin
a.draw;
b.draw
end
[/red]
button1Click执行有问题吗?有什么问题?为什么?