싱글턴 패턴이란? 인스턴스가 하나임을 보장하는 디자인 패턴 처음 1개의 인스턴스만 생성한 후 이후 같은 인스턴스를 사용한다. 주로 무상태 객체나 설계상 유일해야 하는 시스템 컴포넌트를 싱글턴으로 만든다. 장점 1개의 인스턴스만 사용하기에 메모리 관점에서 효율적이다.
Enum 클래스 열거형 타입이라고도 부르는 Enum은 JDK 1.5 이후부터 사용할 수 있다. Enum은 여러 상수로 이루어진 특수 데이터 타입이다. 열거형은 위와 같이 서로 관련있는 상수들을 모아 집합으로 정의한 것이다. Enum 타입의 특징 열거형을 선언하면