Is there a way to make an 'if' statement that applies to the whole code?
I'm doing a user-input text-based program. And I basically want the user to be able to type 'quit' at any time, and that'll end the program. But I don't really want to have
if (_line .equals("quit"))
quit();
for every single time there's a bit of text-input.
Is there a way to do this? Any time the user types in 'quit', quit(); runs?