Код: Выделить всё
public interface SomeAbstractResult {}
public interface SomeInterface {
Collection someMethod();
SomeAbstractResult someMethod2();
}
Код: Выделить всё
public class SomeConcreteResult implements SomeAbstractResult{}
public class SomeClass implements SomeInterface {
SomeConcreteResult abc;
Collection xyz;
@Override
public Collection someMethod() {
return this.xyz; //this doesn't work
}
@Override
public SomeAbstractResult someMethod2() {
return this.abc; // this works fine
}
}
Код: Выделить всё
incompatible types: Collection cannot be converted to CollectionПодробнее здесь: https://stackoverflow.com/questions/798 ... ninterface