싱글톤의 모든 것. 까지는 좀 구라고. '이 정도 알면 어디가서 싱글톤이 뭔지는 안다고 할 수 있다' 정도가 아닐까 싶다. 1. 전통적인 싱글톤 방식 public class Singleton { private static Singleton uniqueInstance; // other instance variable in here public static Singleton getInstance() { if (uniqueInstance == null) { uniqueInstance = new Singleton(); } return uniqueInstance; } } 문제점: 멀티스레드 환경에서, if 문에 두 스레드(혹은 그 이상)가 동시에 들어가서 인스턴스가 두 개(혹은 그 이상)가 만들어질 수 있음. 2..