首页 > TAG信息列表 > SingletonTest

单例设计模式-小姐

饿汉式 -方式一 public class SingletonTest { private SingletonTest(){} private static SingletonTest instance = new SingletonTest(); public static SingletonTest getInstance() { return instance; } } 方式二 public class SingletonTest {