class A{
public A(){
System.out.println(“A”);
}
}
class B extends A{
public B(){
System.out.println(“B”);
}
public static void main(String[] args){
B b=new B();
}
}
输出A,换行,输出B
class A{
public A(){
System.out.println(“A”);
}
}
class B extends A{
public B(){
System.out.println(“B”);
}
public static void main(String[] args){
B b=new B();
}
}
输出A,换行,输出B