标签:public 角色 ace rap space text sts ext wrap
public class Singleton { private static final Singleton singleton = new Singleton(); private Singleton() { System.out.println("初始化"); } public static Singleton getSingleton() { System.out.println("获得单例"); return singleton; } }
public class Main { public static void main(String[] args) { Singleton singleton = Singleton.getSingleton(); } }
标签:public 角色 ace rap space text sts ext wrap
原文地址:https://www.cnblogs.com/use-D/p/9576438.html