设计模式-单例模式
摘要:在程序中保证某类只有一个实例的几个方法: 1. classic singleton pattern 1 public class Singleton { 2 private static Singleton uniqueInstance ; 3 private Singleton() {} 4 public static Singleton getInstance() { 5 if (uniqueInstance == null) { 6 return new Singleton(); 7 }...
阅读全文
posted @ 2013-10-28 16:18
浙公网安备 33010602011771号