摘要:
反射调用私有构造器创建对象 Class c=hungrysingleton.class; Constructor constructor=c.getDeclaredConstructor(); constructor.setAccessible(true);//入侵 hungrysingleton h1= (hungrysinglet... 阅读全文
摘要:
恶汉模式public class hungrysingleton implements Serializable{ private final static hungrysingleton h; static { h=new hungrysingleton(); } private hungrysi 阅读全文