《劍指offer》面試題答案彙總(Java版)

面試題2:實現Singleton模式 (1)餓漢模式 public class Singleton{ private static Singleton instance = new Singleton(); private Singleton(){} public static Singleton getInstance(){ return instance; } }須要使用static來保證是類
相關文章
相關標籤/搜索