1.Singleton(单例)作用:保证类只有一个实例;提供一个全局访问点JDK中体现:(1)Runtime(2)NumberFormat类图:
public class Singleton { private static Singleton instance=new Singleton(); private Singleton() { } public static Singleton newInstance() { return instance; } }