title: Java Enum Types - Self Printing Enums
body: <p>I'm trying to write a java function that takes as a parameter an enum type (part of a console based menuing system). This function will then print all of the string representations in the enum. </p>
  
  <p>The enum looks like this:</p>
  
  <pre><code>protected enum main{
      Option1,
      Option2,
      Option3,
      ...
      OptionN,
  }
  </code></pre>
  
  <p>My display function looks like this</p>
  
  <pre><code>public void displayMenu(Enum menu) {
       // Get values from enum type
       Enum menuOps = menu.values();
  
       // Iterate over values and print
       for(int i =0 ; i &lt; menuOps.length; i++)
              System.out.println( i + menuOps[i].toString() );
  }
  </code></pre>
  
  <p>My problem: Apparently I must not be doing this correctly. The "menu" parameter object doesn't have a values() method in this scenario.</p>
  
  <p>The desired outcome would be the displayMenu() function having an output of:</p>
  
  <pre><code>Option1
  Option2
  Option3
  ...
  OptionN
  </code></pre>
  
  <p>Any pointers on where I'm going wrong with this? Any tips on how to implement this functionality?</p>
  
  <p>Much obliged,</p>
  
  <p>Noob</p>