attempting to use incompatible return type
Hi.
Why the following code gives me
GenericReturn.java:15: test.B1.InnerB is not abstract and does not override abstract method f1() in test.A1.InnterA
class InnerB extends A1<?>.InnterA {
^
GenericReturn.java:18: f1() in test.B1.InnerB cannot override f1() in test.A1.InnterA; attempting to use incompatible return type
found:java.util.Collection<? extends test.A1<capture of ?>.InnterA>
required:java.util.Collection<? extends test.A1<capture of ?>.InnterA>
public Collection<? extends A1<?>.InnterA> f1() {
^
GenericReturn.java:17: method does not override a method from its superclass
@Override
class A1<Textends A1>{
abstractclass InnterA{
publicabstract Collection<?extends InnterA> f1();
}
}
class B1extends A1<B1>{
class InnerBextends A1<?>.InnterA{
@Override
public Collection<?extends A1<?>.InnterA> f1(){
returnnull;
}
}
}
Thanx.

