摘要: 单例模式 饿汉模式 public class Singleton { //1,私有构造方法 private Singleton() {} //2,在本类中创建本类对象 private static Singleton instance = new Singleton(); //3,提供一个公共的访问 阅读全文
posted @ 2021-06-05 22:15 一名不断学习的程序猿 阅读(50) 评论(0) 推荐(0)