This is not possible and it cannot be in Java, at least. Think of the following scenario:
interface Base<K> { K get(); } interface A extends Base<String> { String get(); } interface B extends Base<Integer> { Integer get(); } interface AB extends A, B { ?? }
When you go try to implement AB, if it were possible, what type would the get() method return. In Java, two methods in a class cannot have the same name/args but different return types.... hence, this is forbidden.
If you actually need some functionality similar to what you would get should Java allow this, I would suggest the following:
abstract class C { A a; B b; String aGet() { return a.get(); } Integer bGet() { return b.get(); } }
Or, to keep generics:
abstract class C<K, T> { Base<K> a; Base<T> b; K getA() { return a.get(); } T getB() { return b.get(); } }