我遇到了使用继承的不兼容返回类型的问题。“试图使用不兼容的返回类型”与接口继承
public interface A { }
public interface B extends A { }
public interface C {
Map<String, A> getMapping();
}
public interface D extends C {
Map<String, B> getMapping();
}
有没有办法使这项工作?
眼下编译器告诉我,我“尝试使用不兼容的返回类型”的接口D.
@alfasin正确的,问题的更新 - 对不起! – jjNford
这对你的问题有很大的改变。 @ user3707125:然后有你的解决方案。 –
听起来像这里的答案家伙... – vikingsteve