懒汉模式的导致的线程问题有三种解决方式:双重判断 public class SingletonThread { private static SingletonThread singleton = null; /** * 私有化实例,防止new出对象 */ private SingletonThread(){} public static SingletonThread getInstance() { if (single
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号