In practice, we will find more problems.
Unit unit1; interfaceuses winapi. windows, winapi. messages, system. sysutils, system. variants, system. classes, VCL. graphics, VCL. controls, VCL. forms, VCL. dialogs; Type tform1 = Class (tform) Procedure formcreate (Sender: tobject); end; IA = interface function getname: string; property name: String read getname; end; TC1 = Class (tinterfacedobject, Ia) function getname: string; virtual; end; TC2 = Class (TC1) function getname: string; override; // overwrite end; TC3 = Class (TC2) function getname: string; override; // overwrite the end; C4 = Class (TC3) function getname: string; override; // overwrite the end; vaR form1: tform1; implementation {$ R *. DFM} {TC1} function tc1.getname: string; begin result: = 'c1'; end; {TC2} function tc2.getname: string; begin result: = 'c2'; end; {TC3} function tc3.getname: string; begin result: = 'c3'; end; {C4} function tc4.getname: string; begin result: = inherited + '0'; end; {test} procedure tform1.formcreate (Sender: tobject); var V1, V2, V3, V4: IA; begin V1: = tc1.create; V2: = tc2.create; v3: = tc3.create; V4: = tc4.create; showmessagefmt ('% s, % s', [v1.name, v2.name, v3.name, v4.name]); // C1, C2, C3, c30end; end.