Is Delphi interface The meaning is different from C ++ and Java?

xiaoxiao2021-03-06  42

The meaning of Delphi interface is not different from C and Java, how can I not do this?

IINTERFACE1 = Interfaceend;

Iinterface2 = interface (ieterface1) procedure method (); end;

Tclass1 = Class (TinterFaceDObject, IINTERFACE2) ... End;

First, the compiler does not recognize that Tclass1 is derived by Iinterface1, must be written as a Tclass1 = Class (TinterFaceDObject, Iinterface2, Iinterface1).

Then, this is not: function xxx (): IINTERFACE2; var obj: TOBJECT; begin obj: = tclass1.create; result: = Obj as Iinterface2; // No result: = interface2 (OBJ); // No end ;

I can't write a beautiful little bit. It seems that my Object Pascal has to look back.

转载请注明原文地址:https://www.9cbs.com/read-73112.html

New Post(0)