如果确实存在二者名称相同了,且在接口中是静态的,
请问在子类中直接取变量取的是哪一个呢?会发生什么呢?
如下例:
public class Father {
public static int ia = 1;
public Father() {
}
}
public interface Interface1 {
public int ia = 2;
}
public class Child extends Father
implements Interface1
{
public Child() {
}
public static void main(String[] args) {
Child child1 = new Child(); //这里用Child定义。
System.out.println( child1.ia );//输出什么???????