单例模式的三种实现方式

懒汉、饿汉、双重校验锁 1、懒汉:需要时才会去创建 public Class Singleton{ private static Singleton instance = null; private Singleton(){} public static synchronized Singleton

posted on 2020-02-13 20:09  黑子菜园  阅读(576)  评论(0编辑  收藏  举报

导航