延迟单例模式public class singleton { private singleton(){} private static class instanceHolder{ static singleton instance = new singleton(); } public static singleton getInstance(){ return instanceHolder.instance; } }