I have the following abstract classes:
public abstract class AbSuperClass1<K,S> {
//class definition
}
and:
public abstract class AbSuperClass2<K,S> {
public abstract <Q extends AbSuperClass1<K,S>> void method(Q arg);
...
}
I then have two concrete implementations
public class Concrete1 extends AbSuperClass<String, String>{
//class definition
}
and:
public class Concrete2 extends AbSuperClass2<String, String>{
public void method(Concrete1 arg){
//method definition
}
}
This will not, however, compile, as Concrete1 is not recognised as a valid type for the argument of method in Concrete2, but as far as I can see Concrete1 is of the correct type, since it extends AbSuperClass1.
Where am I going wrong?