大侠帮忙看看结果为什么会是0,而不是传入的参数100呢?
abstract class Demo{public Demo(){
this.print();
}
public abstract void print();
};
class DemoImpt extends Demo{
private int x = 10;
public DemoImpt(int x){
this.x = x;
}
public void print(){
System.out.println("x=" + this.x );
}
}
public class CaseDemo{
public static void main(String args[]){
new DemoImpt(100);
}
}