JAVA DESIGN PATTERN Questions and Answers

Is it possible to write thread safe singleton in Java?

To write thread safe singleton in Java there are multiple ways for example by using static singleton instance initialized during class loading, by writing singleton using double checked locking. Java Enum is the simplest way to create thread safe singleton.