I have encountered two patterns to make a singleton class

1. Holder class

```java
public class Singleton {
    private static final class Holder {
       private static final Singleton INSTANCE = new Singleton();
    }

    public static Singleton obtain() {
        return Holder.INSTANCE;
    }
}

```
2. Instance variable class

```java
public class Singleton {
    private static volatile Singleton sInstance;

    public static Singleton getInstance() {
        if (sInstance == null) {
        synchronized (LOCK) {
            if (sInstance == null) {
                sInstance = new Singleton();
            }
        }
       return sInstance;
    }
}

```

What is the differnce beetwen the two in regards to performance and best-practices?