Code //继承一个类 type TSomeControl =class(TControl); //根类 TObject type TMyClass =class end; //等价于 type TMyClass =class(TObject) end;
4.基类和子类
Code type
TFigure =class(TObject);
TRectangle =class(TFigure);
TSquare =class(TRectangle); var
Fig: TFigure; //the variable Fig can be assigned values oftype TFigure, TRectangle, and TSquare.
5.获取对象类型
Code type objectTypeName =object (ancestorObjectType)
memberList end;