动手动脑:
源程序:
public class FuGai {
public static void main(String[] args) {
// TODO Auto-generated method stub
B b=new B();
b.shuChu();
b.shuChuA();
}
}
class A{
public void shuChu(){
System.out.println("A");
}
}
class B extends A{
public void shuChu(){
System.out.println("B");
}
public void shuChuA(){
super.shuChu();
}
}
结果截图:
时间: 2024-12-09 20:58:22