单例模式要点

1、构造方法私有

   private 类名(){}

2、实例化类,必须为private static final所修饰的

   private static final 类名 single= new 类名();

3、静态返回实例方法

   public static 类名 get类名Instance(){ return 实例名;}

原文地址:https://www.cnblogs.com/cyjch/p/2340426.html