I have declared the following interface in Java:
public interface ITest {
void doStuff();
}
which is implemented by another few classes who overwrite the doStuff() method. I then use this interface as the type in a function:
public gonnaDoSomeStuff(ITest fun) {
fun.doStuff();
}
However, Java (and Eclipse) state that the method is undefined for type ITest. What am I doing wrong?
It turns out that the class containing my gonnaDoSomeStuff method was appended with a generic, which was being referenced instead of the actual interface.
Wrong
Right