싱글톤 (1) 썸네일형 리스트형 Singleton class 설계 유용하면서 간단한 디자인패턴 : 싱글톤 패턴 Singleton class Basic type public class Singleton { private volatile static Singleton uniqueInstance = null; private Singleton() {} public static Singleton getInstance (){ if ( uniqueInstance == null){ synchronized( Singleton.class){ if (uniqueInstance == null) uniqueInstance = new Singleton(); } } return uniqueInstance; } } 이전 1 다음