I was doing some research about singletons, specifically regarding lazy vs eager initialization of singletons.
An example of eager initialization:
public
You first design is actually lazy. Think about it, the instance is only created when the class is initialized; the class is only initialized when the getSingleton()
method is called [1]. So the instance is only created when it's asked for, i.e. it's lazily created.
[1] http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.4.1