Java 单例类 Skeleton|-|&tag=Java
public class Skeleton {
private static volatile Skeleton instance;
private Skeleton() {
}
public static Skeleton getInstance() {
if (instance == null) {
synchronized (Skeleton.class) {
if (instance == null) {
instance = new Skeleton();
}
}
}
return instance;
}
}