android单例模式

    xiaoxiao2022-06-27  67

    懒汉模式: public class ImageUtil { private static ImageUtil instance = null; private ImageLoader mImageLoader; private ImageUtil() { mImageLoader = ImageLoader.getInstance(); } public static synchronized ImageUtil getInstance() { if (instance == null) { instance = new ImageUtil(); } return instance; }

    }

    转载请注明原文地址: https://ju.6miu.com/read-1124058.html

    最新回复(0)