methodfailure4.java

来自「gcc的组建」· Java 代码 · 共 41 行

JAVA
41
字号
import java.util.*;public class MethodFailure4 {  public static String call(A obj) {    return "A";  }  public static String call(I obj) {    return "I";  }  interface I {}  static class A {}  static class B extends A implements I {}  static class C extends B {}  public static A getA() {    return new A();  }  public static B getB() {    return new B();  }  public static C getC() {    return new C();  }  public static I getI() {    return new C();  }    // this method invocation is ambiguous    public static void main(String[] argv) {    call( getC() );  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?