intelli

导航

 

[last updated :2016/4/24] 未完成

0

1.饿汉式单例

public class Singleton {
    private static Singleton uniqueInstance = new Singleton();
    private Singleton() {
       // Exists only to defeat instantiation.
    }
    public static Singleton getInstance() {
       return uniqueInstance;
    }
    // other methods...
}


posted on 2016-04-24 23:35  intelli  阅读(195)  评论(0)    收藏  举报