public class C extends B implements A {
  public void pX(){
    System.out.println(x);
  }
  public static void main(String[] args) {
    new C().pX();
  }
}
class B{
    int x =1;
}
interface  A{
  int x = 0;
}
 
只需要把B类中的x声明为private私有即可。几口定义的变量常量均为常量,定义的方法为抽象方法。、
所以字段x重复了,及常量不可在赋值。