title: In Java, when is the constructor for an enumerated constant invoked?
body: <p>To use a contrived example in Java, here's the code:</p>
  
  <pre><code>enum Commands{
     Save("S");
     File("F");
  
     private String shortCut;
     private Commands(String shortCut){ this.shortCut = shortCut; }
     public String getShortCut(){ return shortCut; }
  }
  </code></pre>
  
  <p>I have the following test/driver code:</p>
  
  <pre><code>public static void main(String args[]){
     System.out.println(Commands.Save.getShortCut());
  }
  </code></pre>
  
  <p>The question is: 
  In Java, when is the constructor for an enumerated constant invoked? In the above example, I am only using the <code>Save</code> enumerated constant. Does this mean that the constructor is called once to create <code>Save</code> only? Or will both <code>Save</code> and <code>File</code> be constructed together regardless?</p>