public class FolderV3Singleton { private FolderV3Singleton() { } private static class DeviceHolder { private static FolderV3Singleton ourInstance = new FolderV3Singleton(); } public static FolderV3Singleton getInstance() { return DeviceHolder.ourInstance; } public List<String> getFolderList() { return folderList; } public void setFolderList(List<String> folderList) { this.folderList = folderList; } private List<String> folderList = null; }
标签:静态,List,private,public,static,folderList,单例,模式,FolderV3Singleton From: https://www.cnblogs.com/wojtek/p/17718406.html