摘要: package designMode; import javax.lang.model.type.ReferenceType; class RealizeType implements Cloneable{ public RealizeType() { System.out.println("具体原 阅读全文
posted @ 2020-01-16 20:34 集大软辅孙忠 阅读(261) 评论(0) 推荐(0) 编辑
摘要: /* * 饥饿式单例模式 不会出现线程安全问题,相对于懒汉式,类加载时不创建对象,调用方法时创建,需要使用syntronized,每次使用需要同步,否则出现线程安全问题 */public class HungrySingleton { private static final HungrySingl 阅读全文
posted @ 2020-01-16 00:17 集大软辅孙忠 阅读(260) 评论(0) 推荐(0) 编辑