package temp;
public class A {
void test(A a) {
}
void test(C b) {
}
void ambiguous() {
B b = new B();
test(b);
}
}
interface C {
}
class B extends A implements C {
}
在方法ambiguous()中的变量b既是A也是C,此时就不知到调用test(A a) 还是test(C b)方法。
转载于:https://blog.51cto.com/hongtaoer/1389100