单例
2019-10-11 本文已影响0人
Taleen_6f6a
private static volatile $NAME$ singleton = null;
private $NAME$() {}
public static $NAME$ getInstance() {
if (singleton == null) {
synchronized ($NAME$.class) {
if (singleton == null) {
singleton = new $NAME$();
}
}
}
return singleton;
}