本帖最后由 alive 于 2014-7-25 22:07 编辑
class A extends B{
A(){
System.out.println("A");
}
A(int x){
this();
System.out.println("A+");
}
/*
void show(){
System.out.println(x);
}*/
}
class B{
int x = 4;
void show(){
System.out.println();
}
B(){}
public B(int x ) {
this.x = x;
System.out.println("B");
}
}
public class Test {
public static void main(String[] args) {
A a = new A(7);
}
}
|
|