(相关资料图)
public class Singleton{ private volatile static Singleton obj; public Singleton(){} public getSingleton(){ if(singleton == null){ synchronized(Singleton.class){ if(singleton == null){ obj = new Singleton(); } } } return obj; }}
X 关闭
Copyright © 2015-2022 亚洲商报网版权所有 备案号:豫ICP备20022870号-9 联系邮箱:553 138 779@qq.com