public class HurrySingleton { private static final HurrySingleton INSTANCE = new HurrySingleton(); //私有化构造子,阻止外部直接实例化对象 private HurrySingleton(){ } /** * <B>方法描述:</B> * <p style="margin-left:20px;color:#A52A2A;"> * 获取类的单例实例 * @return <span style="color: #008080;"> 返回类的唯一实例 </span> */ public static HurrySingleton getInstance(){ return INSTANCE; } } |