Hey guys, basically I'm trying to create a program that loops indefinitely until the user enters "exit" for the input. Except whenever I enter anything other then an integer value, the program will throw a NumberFormatException error. I'm a little unsure why this is because it shouldn't parse anything except the integer part of the input...which is why I don't understand why the code doesn't exit smoothly.
Don't use == false. Use while (!line.equals("quit")).
The problem is that you have got entry for the line before you parse it; if you happen to enter "quit" then it will try to get an integer out of "quit." You need to find a way to get the line and test it before trying to get an int out of it.
I shall refer you back to an older post where somebody seemed to find it hard to get a while loop to work, in that case looking for "stop." Try here. There is unfortunately a lot to read, but copying what Robin Lane finally used might sort out your problem.