title: What is the advantage of Bill pugh solution over Lazy Initialized Singleton solution?
body: <p><strong>Bill pugh solution</strong></p>
  
  <pre><code>public class ThreadSafeSerializedSafeSingleton implements Serializable {
  
      private ThreadSafeSerializedSafeSingleton() {
      }
  
      private static class SingletonHelper {
          private static final ThreadSafeSerializedSafeSingleton instance = new ThreadSafeSerializedSafeSingleton();
      }
  
      public static ThreadSafeSerializedSafeSingleton getInstance() {
          return SingletonHelper.instance;
      }
  
  }
  </code></pre>
  
  <p><strong>VS</strong></p>
  
  <p><strong>Lazy Initialized Thread Safe Singleton</strong></p>
  
  <pre><code>public class ThreadSafeSingleton {
  
      private static ThreadSafeSingleton instance;
  
      private ThreadSafeSingleton() {
      }
  
      public static synchronized ThreadSafeSingleton getInstance() {
          if (instance == null) {
              instance = new ThreadSafeSingleton();
          }
          return instance;
      }
  
  }
  </code></pre>