标签:des io ar java sp 2014 on c r
package prac_1; /** * <p>Title: 接口和抽象函数</p> * <p>Description: 演示继承抽象函数和实现接口</p> * <p>Copyright: Copyright (c) 2014</p> * <p>Filename: Play.java</p> * @author 王海涛 * @version 0.1 */ //接口 interface player { int flag = 1; void play();//播放 void pause();//暂停 void stop();//停止 }//end :) //抽象类 abstract class playing { public void display(Object oPara) { System.out.println(oPara); } abstract void winRun(); }//end :) //继承了playing抽象类和实现类player接口 public class Play extends playing implements player { public void play() { display("继承了play,正在playing@_@"); } public void pause() { display("继承了pause,正在pause!!!"); } public void stop() { display("继承了stop ,正在stoping"); } void winRun() { display("抽象类中winRun的具体实现。"); } public static void main(String[] args) { Play p = new Play(); p.play(); p.pause(); p.stop(); p.winRun(); } }//end :)
标签:des io ar java sp 2014 on c r
原文地址:http://blog.csdn.net/christprince007/article/details/39612397