/** * Created by hero on 16-4-6. */ public class Singleton { public static Singleton getInstance() { return SingletonHolder.singleton; } private static class SingletonHolder { private static Singleton singleton = new Singleton(); } private Singleton() { } }