一个delphi初学者的简单语法问题(急求)
我最近看书的时候有一个如下的实例:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
type
TPerson=class
procedure Infor;
end;
TEmployee=class(TPerson)
procedure Infor;
end;
procedure TPerson.Infor;
begin
Writeln('TPerson.Infor');
end;
procedure TEmployee.Infor;
begin
Writeln('TEmployee.Infor');
end;
var
P1:TPerson;
E1:TEmployee;
begin
P1:=TPerson.Create;
P1.Infor;
P1.Destroy;
P1:=TEmployee.Create;
P1.Infor;
[color=#800080]TEmployee(P1).Infor;[/color]
P1.Destroy;
E1:=TEmployee.Create;
E1.Infor;
E1.Destroy;
Readln;
end.
其中的代码一般都能懂,但是TEmployee(P1).Infor;这一句不明白是什么意思,特别是TEmployee(P1)这里不明白,请各位高手
给我讲解一下。不甚感谢!!