Where should I put interface?

Posted by Roman on Stack Overflow See other posts from Stack Overflow or by Roman
Published on 2010-04-20T12:16:35Z Indexed on 2010/04/20 12:23 UTC
Read the original article Hit count: 189

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about java

Related posts about interface