摘要:
1. singleton延时初始化class Singleton { private static Singleton _instance = null; public synchronized Singleton getInstance() { if(_instance == null) { _instance = new Singleton(); } return _instance; }}上述代码加入synchronized性能会降低,可以采用内嵌class的方式来优化掉这个不必要的synchr... 阅读全文