我有以下代码片段
public class Test {
static interface I1 { I1 m(); }
static interface I2 { I2 m(); }
static interface I12 extends I1,I2 { I12 m(); }
public static void main(String [] args) throws Exception {
}
}
当我尝试编译它时,我得到了错误。
Test.java:12: types Test.I2 and Test.I1 are incompatible; both define m(), but with unrelated return types.
如何避免这种情况?