设计模式单例模式

/**
 * @version 1.0
 * @author Rollen-Holt 
 * 设计模式之 ---单例模式
 * */

class hello{
	private hello(){
		System.out.print("hello");
	}
	public static hello getHello(){
		return new hello();
	}
	public static void main(String[] a0){
		hello.getHello();
	}
}

  

原文地址:https://www.cnblogs.com/rollenholt/p/2144858.html