单例和工厂的代码
摘要:
单例Public class Singleton(){Private static Singleton singleton= new Singleton();Private Singleton(){}Public static Singleton getSingleton(){Return singleton;}}工厂Public interface IProduct{void produce();}Public class product implements IProduct{Public void produce(){System.out.println("produce&qu 阅读全文
posted @ 2013-09-22 23:12 笨'小孩 阅读(183) 评论(0) 推荐(1) 编辑