title: Java: Printing the options of a switch statement
body: <p>I have some code in which I ask the user for a string input which I then match against some options in a switch so the program knows how to proceed. </p>
  
  <pre><code> switch (algorithm.toLowerCase()) {
  
          case "selection sort":
              // Selection sort stuff
              break;
  
          case "insertion sort":
              // Insertion sort stuff
              break;
  
          case "exit":
              // Default, just exit.
              System.exit(0);
  </code></pre>
  
  <p>However for a user that isn't myself, they don't know the options that they can enter. An obvious solution would be to hardcode in a print statement which tells them the options, but I was wondering if there is a programmatic way of displaying the cases of my switch before I capture the user input.</p>
  
  <p>I'm thinking some sort of data structure containing the options, but I'm not sure of which way would best utilise Java and conform to its standard practices.</p>