| Код | type TProduct = class(TComponent) private FName: string; FPrice: real; procedure SetFName(const Value: string); procedure SetFPrice(const Value: real);
public constructor Create(const nm:string; const pr:real); destructor Destroy(); procedure Show(j: integer); virtual; abstract;
published property AdName: string read FName write SetFName; property AdPrice: real read FPrice write SetFPrice; end;
type TGoods = class(TProduct) private FMassa: integer; procedure SetFMassa(const Value: integer);
public constructor Create(const nm:string; const pr:real; const ma:integer); destructor Destroy(); procedure Show(j: integer); override;
published property AdMassa: integer read FMassa write SetFMassa; end;
|
Если в классе TProduct убрать у ф-ции Show убрать "virtual; abstract" и в implementation определить ее, то что произойдет, при вызове функции Show у объекта класса TGoods?
P.S. Не могу до конца врубиться как работает полиморфизм. |