program Project1;
{$APPTYPE CONSOLE}
type
{class Ta 默认继承与 Tobject }
Ta = class
procedure show;virtual;
end;
{class Tb 继承于 Ta }
tb = class(ta)
procedure show;override;
end;
{implement}
procedure ta.show;
begin
write('a');
end;
procedure tb.show;
begin
inherited show;
write('b');
end;
var
x:tb;//定义一个 tb 变量
begin
x:= tb.create;
x.show;
Readln;
end.
Delphi7 中类说明
最新推荐文章于 2023-03-19 22:14:23 发布