两种都是静态的
1、
public class Single{
private Single(){          立即加载
private static Single s= new Single();
public  static Single getSingle(){
     return s;
      }    
}
2、
public class Single{
private Single(){  }        延迟加载
private static class MySingle{
     private static  Single  s = new Single();
}
public  static Single getSingle(){
     return MySingle.s;
      }    
原文:https://www.cnblogs.com/lh-lh/p/11838938.html