type
TPhone = class
public
Model: string;
constructor Create(const AModel: string);
end;
TEmployee = class
public
FirstName, LastName: string;
PersonalPhone: TPhone;
constructor Create(const AFirstName,
ALastName: string; APhone: TPhone);
end;
constructor TPhone.Create(const AModel: string);
begin
Model := AModel;
end;
constructor TEmployee.Create(const AFirstName,
ALastName: string; APhone: TPhone);
begin
FirstName := AFirstName;
LastName := ALastName;
PersonalPhone := APhone;
end;
var
NokiaPhone: TPhone;
Kim: TEmployee;
begin
NokiaPhone := TPhone.Create('Nokia 6610');
Kim := TEmployee.Create('Victoria', 'Kim',
TPhone.Create('iPhone 5'));
WriteLn(NokiaPhone.Model);
WriteLn(Kim.PersonalPhone.Model);
end.