开发者

Where should I put interface?

I program a class in which I have a method which takes an callback object from an external software. At the moment Eclipse says that it does not know the type of the object I gave as argument (it is expectable since I do not specify this type, it's done by the external software).

So, I think I need to write an interface for the object which I give as an argument to my 开发者_开发技巧method. In this respect I have two questions.

  1. Is it really so? Can I solve the mentioned problem in the mentioned way.

  2. If it is the case, where should I put this interface? In the same file where my class is? In the class? Outside of the class?


If the object is from "external software", then they should be providing you with some kind of API so that you can manipulate/inspect the callback object. So what you likely need to do is get the other software's API library and add it to the path for your eclipse project. Then eclipse should know eveyrthing it needs to about the object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜