NormR, on 23 September 2016 - 03:07 PM, said:
Quote
Mostly that is done with if statements that compare the user's input against valid values.
Quote
The code inside of the while loop will loop back as long as the variable: badInput is true.
Setting badInput to false will allow the execution to exit the while loop.
so what would be a correct way to say if the choice does not equal. Like normally the if statement would be if(choice.equals("bababa")) but what if I wanted it to not equal that. That way I could make it so if it does not equal that then system...("Input invalid") and end while loop?

New Topic/Question
Reply




MultiQuote



|