pubic interface A{
public void method1(){}
}
public class b implements A{
}public abstract interface A{
public void method1();
}
class b implements A{
public void method1(){
System.out.print("impA") ;
};
public static void main(String args[]){
A test = new b();
test.method1();
}
}
为什么test.method1();他能找到CLASS b中的method1。
这应该是向上转型吧,java会动态绑定