1、构造方法私有
private 类名(){}
2、实例化类,必须为private static final所修饰的
private static final 类名 single= new 类名();
3、静态返回实例方法
public static 类名 get类名Instance(){ return 实例名;}
1、构造方法私有
private 类名(){}
2、实例化类,必须为private static final所修饰的
private static final 类名 single= new 类名();
3、静态返回实例方法
public static 类名 get类名Instance(){ return 实例名;}
转载于:https://www.cnblogs.com/cyjch/archive/2012/02/06/2340426.html