android中的單例模式

這是本博看了《android源碼設計模式解析與實戰》的總結。 單例模式的實現方式 1.懶漢模式 public class Singleton{ private static Singleton sInstance; private Singleton(){ } public static synchronized Singleton getInstance(){ if(sInstance
相關文章
相關標籤/搜索