摘要: 1. 你就是单例你呱呱落地到这个世界的时候,这就是单例的产生,你是世界上唯一无二的存在。此时,你是父辈、祖辈的宝贝。他们都想和你亲近。public class Singleton { private final static Singleton INSTANCE = new Singleton(); //婴儿呱呱落地 // Private constructor suppresses private Singleton() {} // default public constructor public static Singleton getInsta... 阅读全文
posted @ 2014-04-03 13:00 一天不进步,就是退步 阅读(1120) 评论(2) 推荐(2) 编辑
摘要: http://www.javaworld.com/article/2073352/core-java/simply-singleton.htmlJAVA DESIGN PATTERNSByDavid GearyThe Singleton pattern is deceptively simple, even and especially for Java developers. In this classicJavaWorldarticle, David Geary demonstrates how Java developers implement singletons, with code 阅读全文
posted @ 2014-04-03 11:13 一天不进步,就是退步 阅读(454) 评论(0) 推荐(0) 编辑