java的单态实现
调用:public static void main(String[] args) {Singleton ex = Singleton.getInstance();Singleton ex1 = Singleton.getInstance();ex.ondo(2);ex1.ondo(3);System.out.println(ex == ex1);}结果:23true
public static void main(String[] args) {Singleton ex = Singleton.getInstance();Singleton ex1 = Singleton.getInstance();ex.ondo(2);ex1.ondo(3);System.out.println(ex == ex1);}