动手动脑4

1.

 

 

package text5;

public class text{

	   public static void main(String[] args){

	      father b = new son(); // Dog 对象
	      b.move(); //执行 Dog类的方法

	   }
	}

	class father{

	   public void move(){
	      System.out.println("father create");
	   }
	}

	class son extends father{

	   public void move(){
	      super.move(); // 应用super类的方法
	      System.out.println("son create");
	   }
	}

  

 

posted @ 2019-10-27 16:48  利威尔  阅读(120)  评论(0编辑  收藏  举报