摘要: interface Fruit{ // 定义一个水果接口 public void eat() ; // 吃水果 } class Apple implements Fruit{ public void eat(){ System.out.println("** 吃苹果。") ; } }; class Orange implements Fruit{ public void eat(){... 阅读全文
posted @ 2016-04-25 10:54 wujixing909 阅读(193) 评论(0) 推荐(0) 编辑
摘要: public class Singleton02 { // 私有的静态的类变量 private static Singleton02 instance = null; // 私有的构造方法 private Singleton02() { } // 静态的公有的方法 public... 阅读全文
posted @ 2016-04-25 10:50 wujixing909 阅读(113) 评论(0) 推荐(0) 编辑
摘要: interface Window{ // 定义Window接口,表示窗口操作 public void open() ; // 打开 public void close() ; // 关闭 public void activated() ; // 窗口活动 public void iconified() ; // 窗口最小化 public void deiconified();// 窗... 阅读全文
posted @ 2016-04-25 10:39 wujixing909 阅读(138) 评论(0) 推荐(0) 编辑
摘要: interface Network{ public void browse() ; // 浏览 } class Real implements Network{ public void browse(){ System.out.println("上网浏览信息") ; } }; class Proxy implements Network{ private Network networ... 阅读全文
posted @ 2016-04-25 10:38 wujixing909 阅读(137) 评论(0) 推荐(0) 编辑