public class AClass<X extends AnInterface>{
public AClass(X x){
}
}
public class Y implements AnInterface{
}
In the calling code if I have:
public static<X extends AnInterface> void main(String args){
AnInterface y = new Y();
AClass a = new AClass<AnInterface>(y);
}
I should be able to get this to work using X in the constructor for AClass right? I am getting errors telling me the contructor for AClass should be of type AnInterface??
EDITED to change AClass a = new AClass<AnInterface>(y);