Tag Archive for 'singleton'

Faster Singleton method in Java

The fastest Singleton design pattern implementation by Bill Pugh:

public class Singleton
{
protected Singleton()
{
// ...
}

private static class SingletonHolder
{
private final static Singleton INSTANCE = new Singleton();
}

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