For example
public interface X{
public void foo(X i);
}
public class Y implements X{//error: doesn't implement foo(X i)...
public void foo(Y i){
fooBar(foo);
}
....
}
Why can’t I do that? And how can I change it so this is possible? What can I do to declare foo in X with a parameter, and then be able to use Y as the parameter type in Y?
Additionally to what Don Boyle said, you can’t change it without hinting the compiler of the intention. You do this by introducing Generics to the interface, like so: