单例模式 dl

public class Singleton04{ private static final class InstanceHolder { private static Singleton04 INSTANCE = new Singleton04(); } public static Singleton04 getInstance() { return InstanceHolder.INSTANCE; }}

 

 

本文来自 鸿洋_ 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/lmj623565791/article/details/24468641?utm_source=copy 

posted @ 2018-09-29 00:53  vcczh  阅读(104)  评论(0)    收藏  举报