摘要: ``` public class Singleton { private static Singleton instance; private Singleton() { } public static Singleton GetInstance() { if(instance == null) { instance = new Singleton(); ... 阅读全文
posted @ 2016-11-08 22:57 yufenghou 阅读(136) 评论(0) 推荐(0)
摘要: 先写一个抽象类,表示一部分 再写叶子节点 public class Leaf extends Component{ public Leaf(String name) { super(name); // TODO Auto generated constructor stub } @Override 阅读全文
posted @ 2016-11-08 22:20 yufenghou 阅读(3100) 评论(0) 推荐(0)
摘要: 这个模式回头再看吧,把我给绕蒙圈了。 测试程序 阅读全文
posted @ 2016-11-08 21:39 yufenghou 阅读(146) 评论(0) 推荐(0)