[fpc-pascal] Is it posible to implement more than one interface in a class defination?

Sven Barth pascaldragon at googlemail.com
Sun Nov 14 13:22:48 CET 2010


On 14.11.2010 13:08, yu ping wrote:
>   For example if there are two Interface : IinterfaceA,IinterfaceB
>   can I implement these two interface in one class?

Yes, you can. Take the following example:

type
   IInterfaceA = interface
     procedure A;
   end;

   IInterfaceB = interface
     procedure B;
   end;

   TMyInterfacedObject = class(TInterfacedObject, IInterfaceA, IInterfaceB)
   public
     procedure A;
     procedure B;
   end;

Regards,
Sven



More information about the fpc-pascal mailing list