饿汉模式
1 public class Single { 2 3 private static Single instance = new Single(); 4 5 private Single(){ 6 System.out.println("Single: " + System.nanoTime()); 7 } 8 9 public static Single getInstance(){ 10 return instance; 11 } 12 }