摘要:
public class SingletonDemo5 implements Serializable{ private static SingletonDemo5 instance; //防止单例被反射 private SingletonDemo5(){ if(null!=instance){ t 阅读全文
摘要:
/** * 测试单例模式:恶汉式 * 有点:线程安全,效率低,类一加载的时候就new对象 * @author codeMan * */public class SingletonDemo1 { private static SingletonDemo1 instance=new SingletonD 阅读全文