4.基類和子類
type
TFigure = class(TObject);
TRectangle = class(TFigure);
TSquare = class(TRectangle);
var
Fig: TFigure;
//the variable Fig can be assigned values of type TFigure, TRectangle, and TSquare.
5.獲取對象類型
type objectTypeName = object (ancestorObjectType)
memberList
end;
6.類的關聯
type
TFigure = class; // forward declaration
TDrawing = class
Figure: TFigure;
...
end;
TFigure = class // defining declaration
Drawing: TDrawing;
...
end;