假设有两个接口定义,里面有相同名称的方法。然后有一个类,要同时实现这两个接口。语法上该怎么写才正确?
请看代码:
type
IMyIntfA = interface
['{03A9D09A-F6C7-42BA-9C01-D3F9A43F3AFB}']
function Hello(const S: string): string;
end;
IMyIntfB = interface
['{C2EDFFEA-95B1-43B8-9C9D-28E32A48FAE7}']
function Hello(const S: string): string;
end;
TForm2 = class(TForm, IMyIntfA, IMyIntfB)
private
{ Private declarations }
public
function HelloA(const S: string): string;
function HelloB(const S: string): string;
function IMyIntfA.Hello = HelloA;
function IMyIntfB.Hello = HelloB;
end;