用Java写一个单例类。

- 饿汉式单例 1 2 3 4 5 6 7 public class Singleton {      private Singleton(){}      private static Singleton instance = new Singleton();      public static Singleton getInstance(){          return instance
相关文章
相关标签/搜索