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;
}
}

0 Responses to “Faster Singleton method in Java”


  • No Comments

Leave a Reply

You must login to post a comment.