Interface with generic parameters- can't get it to compile
- by user997112
I have an interface like so:
public interface MyInterface<E extends Something1> {
public void meth1(MyClass1<E> x);
}
and I have a subclass whose superclass implements the above interface:
public class MyClass2<E extends Something1> extends Superclass{
public MyClass2(){
}
public void meth1(MyClass1 x) {
// TODO Auto-generated method stub
}
}
superclass:
public abstract class Superclass<E extends Something1> implements MyInterface{
MyClass1<E> x;
protected E y;
public Superclass(){
}
}
the problem is that the parameter for meth1() is supposed to be generic. If I do MyClass1 it doesn't like it and the only way I can get it to compile is by leaving out generic parameters- which feels wrong.
What's going wrong?