title: What is the best approach for using an Enum as a singleton in Java?
body: <p>Building on what has been written in SO question <a href="https://stackoverflow.com/questions/70689/best-singleton-implementation-in-java">Best Singleton Implementation In Java</a> - namely about using an enum to create a singleton - what are the differences/pros/cons between (constructor omitted)</p>
  
  <pre><code>public enum Elvis {
      INSTANCE;
      private int age;
  
      public int getAge() {
          return age;
      }
  }
  </code></pre>
  
  <p>and then calling <code>Elvis.INSTANCE.getAge()</code></p>
  
  <p>and</p>
  
  <pre><code>public enum Elvis {
      INSTANCE;
      private int age;
  
      public static int getAge() {
          return INSTANCE.age;
      }
  }
  </code></pre>
  
  <p>and then calling <code>Elvis.getAge()</code></p>