猜猜吧,不要运行程序!!!
abstract class A1{
public A1(){
this.print() ;
}
public abstract void print() ;
};
class AA extends A1{
private int x = 100 ;
public AA(int x){
this.x = x ;
}
public void print(){
System.out.println("猜猜x的值是多少:" + x) ;
}
};
public class Textqianda {
public static void main(String args[]){
A1 a = new AA(10) ;
}
} |