首页 > 代码库 > 07-JAVA继承与接口

07-JAVA继承与接口

动手动脑:

 

技术分享

 

 

源程序:

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();

       }

}

结果截图:技术分享

07-JAVA继承与接口