package dps_01_build_type.dp01_singleton.lazy.example1; import dps_01_build_type.dp01_singleton.lazy.example1.LazySingleton; /** * 测试类<br> * @author Administrator */ public class Test { /** * @param args */ public static void main(String[] args) { //懒汉式单例: LazySingleton instance1 = LazySingleton.getInstance(); LazySingleton instance2 = LazySingleton.getInstance(); //从输出结果可以看出两次创建的实例是同一对象 System.out.println("懒汉式单例:"); System.out.println(instance1); System.out.println(instance2); } }
最近下载更多
xb1406112453 LV5
2021年2月27日
moomin709 LV24
2020年11月17日
shoucheng LV19
2020年6月17日
chinaboyme LV3
2020年4月1日
yuanjh2001 LV7
2020年3月25日
MaNong码农 LV7
2020年1月4日
906396135 LV7
2019年10月31日
redredLZ LV4
2019年10月21日
jeff2020 LV2
2019年9月28日
aisuzhen LV10
2019年9月17日