The Java Singleton pattern is a design pattern that governs the instantiation process. According to this design pattern, there can only be one instance of your class per JVM at any time. "Since there is only one Singleton instance, any instance fields of a Singleton will occur only once per class, just like static fields. Singletons often control access to resources such as database connections or sockets." [When is a Singleton not a Singleton?]
The most usual implementation of a Singleton in Java is done by having a single instance of the class as a static field.
You can create that instance using lazy initialization, which means that the instance is not created when the class loads but when it is first used.
...
Noncompliant Code Example
Anther Another solution for Singletons to be thread-safe is double-checked locking. It is not guaranteed to work because compiler optimizations can make the assignment of the new Singleton object before all its fields are initialized.
...