Program PFutureInterfaceDemo;

{$APPTYPE CONSOLE}

uses
  System;

type
  IDelphi = interface
    function GetMsg1 : String;
  end;

  IDotNet = interface
    function GetMsg2 : String;
  end;

  IDelphiForNET = interface(IDelphi, IDotNet)
    function GetGift : String;
  end;

  TImplClass = class(System.Object, IDelphiForNET)
  public
    //IDelphi
    function GetMsg1 : String;
    //IDotNet
    function GetMsg2 : String;
    //IDelphiForNET
    function GetGift : String;
  end;

  function TImplClass.GetMsg1 : String;
  begin
    Result := 'Delphi仍是最棒的Win32开发工具!';
  end;

  function TImplClass.GetMsg2 : String;
  begin
    Result := '.NET是Window平台的世代交替!';
  end;

  function TImplClass.GetGift : String;
  begin
    Result := 'Delphi For NET为Delphi在.NET下再创新局!';
  end;

var
  implObj : TImplClass;
  intf1 : IDelphi;
  intf2 : IDotNet;
  intf3 : IDelphiForNET;


begin
  implObj := TImplClass.Create;

  intf1 := implObj;
  Console.WriteLine(intf1.GetMsg1);

  intf2 := implObj;
  Console.WriteLine(intf2.GetMsg2);

  intf3 := implObj;
  Console.WriteLine(intf3.GetGift);
end.
