特牛生活网

单例(Singleton)设计模式_singleton设计模式-CSDN博客

网友收藏
单例(Singleton)设计模式1.概念某个类只能存在一个对象实例,并且该类只提供一个取得该对象实例的方法2.实现方式懒汉式// 这种写法线程不安全package com.lmwei.p20;import com.sun.org.apache.xpath.internal.operations.Or;public class SingletonTest { public static void main(String[] args) { Order o1_singleton设计模式