前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
package org.itstack.demo.design; public class Singleton_05 { private static Singleton_05 instance; private Singleton_05() { } public static Singleton_05 getInstance(){ if(null != instance) return instance; synchronized (Singleton_05.class){ if (null == instance){ instance = new Singleton_05(); } } return instance; } }