title: Writing an exception class to throw if user string input by user is not an accepted one?
body: <p>EDIT:
  Sorry I didn't make this clear earlier, I already wrote this program and completed it using nested if's, what I'm trying to do now, is practice writing exception classes, I do understand that this way is way less efficient than the way I have previously wrote it, but I am trying to do it this way to further learn more about java.  Thanks again.</p>
  
  <p>Basically the only strings you're allowed to type are, "print, sortfirst, sortlast, sortgrade" and I can't figure out how to write this without a winded if statement.  </p>
  
  <p>the class I have written is;</p>
  
  <pre><code>public class WrongCommandException extends Exception
  {
  public WrongCommandException (String message)
  {
      super(message);
  }
  }
  </code></pre>
  
  <p>would i have to construct arguments in this class or would I do it in my main class inside the while loop reading off user input?</p>