继承体系-代码体现

package demo;

public class ExtendDemo {

public void run(){
System.out.println("run");
}
}

--------------------------------------------------------

package demo;

public class FuDemo extends ExtendDemo{

public void show(){
System.out.println("show");
}
}

-----------------------

package demo;

public class ZiDemo extends FuDemo{

public void play(){
System.out.println("play");
}
}

-------------------------------

package demo;

public class Demo {

public static void main(String[] args) {
ZiDemo demo =new ZiDemo();
demo.play();
demo.run();
demo.show();
}
}

 

posted @ 2016-10-04 19:45  留白*  阅读(107)  评论(0编辑  收藏  举报