i am trying to make a big loop for console application in java, it works but after every step, for example after pressing "a" (code, corresponding to "a" letter) works , but every time it writes :"Your input is not correct, please try again", i don't understand why
boolean inputIsValid = false;
while (!inputIsValid) {
String input = reader.readLine();
if (input.equals("a")) {
.....
}
if (input.equals("p")) {
.....
}
if (input.equals("q")) {
break;
}
else {
System.out.println("Your input is not correct, please try again");
}
}