Singleton without use of Enum eager initialization

suggest change
public class Singleton {    

    private static final Singleton INSTANCE = new Singleton();

    private Singleton() {}

    public static Singleton getInstance() {
        return INSTANCE;
    }
}

It can be argued that this example is effectively lazy initialization. Section 12.4.1 of the Java Language Specification states:

A class or interface type T will be initialized immediately before the first occurrence of any one of the following:

Therefore, as long as there are no other static fields or static methods in the class, the Singleton instance will not be initialized until the method getInstance() is invoked the first time.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Singletons:
* Singleton without use of Enum eager initialization

Table Of Contents
8 Arrays
10 Maps
11 Strings
18 Singletons
25 JAXB
29 Enums
32 Audio
41 Scanner
63 Logging
75 Lists
78 Sets
89 JAX-WS
96 XJC
98 Process
106 Modules
114 Applets
122 JNDI
139 JavaBean
141 Literals
144 Packages
150 JMX
153 JShell
159 Sockets
167 Enum Map
175 Hashtable
177 SortedMap