views:

69

answers:

1

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?

+4  A: 

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.

M. Jessup