interface A{
int x = 0;
}
class B{
int x =1;
}
class C extends B implements A {
public void pX(){
System.out.println(x);
}
public static void main(String[] args) {
new C().pX();
}
}
interface A{ int x = 0;
}
class B{ int x =1;
}
class C extends B implements A { //同时继承B和实现A,但是A和B里面都定义了成员x,冲突了
public void pX(){
System.out.println(x);
}
public static void main(String[] args) {
new C().pX();
}
}