cbza-q
Last Updated: February 25, 2016
·
310
· zergood

Thread safe java singleton

package com.journaldev.singleton;

public class BillPughSingleton {

private BillPughSingleton(){}

private static class SingletonHelper{
    private static final BillPughSingleton INSTANCE = new BillPughSingleton();
}

public static BillPughSingleton getInstance(){
    return SingletonHelper.INSTANCE;
}

}