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.
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.
the class I have written is;
public class WrongCommandException extends Exception
{
public WrongCommandException (String message)
{
super(message);
}
}
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?