摘要: 饿汉模式 public class Singleton { /* 在类装载的时候就完成实例化 */ private static Singleton instance = new Singleton(); /* 私有构造方法,防止被实例化 */ private Singleton() { } /* 阅读全文
posted @ 2023-04-20 11:48 穆海如枫 阅读(43) 评论(0) 推荐(0)