title: bill pugh singleton, why thread safe?
body: <p>Why is Bill Pugh's  Singleton design pattern thread safe?</p>
  
  <pre><code>public class Logger {
      private Logger() {
          // private constructor
      }
  
      // static inner class - inner classes are not loaded until they are
      // referenced.
      private static class LoggerHolder {
          private static Logger logger = new Logger();
      }
  
      // global access point
      public static Logger getInstance() {
          return LoggerHolder.logger;
      }
  
      //Other methods
  }
  </code></pre>