{ TDocManager }
procedure TDocManager.startWorking;
begin
showmessage(’Managing Document’);
end;
procedure TForm1.Button1Click(Sender: TObject);
const
eNum=3;
var
Employee:array of TEmployee;
i:integer;
begin
setLength(Employee,eNum);
Employee[0]:=TProgramer.Create;
//把基类引用employee[0]指向刚创建的TProgramer对象
Employee[1]:=TBusinessMan.Create;
//把基类引用employee[1]指向刚创建的TBusinessMan对象
文章来源于领测软件测试网 https://www.ltesting.net/