I am a beginner to java and trying to implement a do while loop for a number of cases within a switch statement.
do {
switch (UserInput){
case "a2":
case "a3":
case "b1":
case "b2":
case "b3":
case "c1":
case "c2":
case "c3":
case "d1":
case "d2":
case "d3":
TextIO.putln("This is a valid move!");
break;
default:
TextIO.putln("Not a valid choice, please try again!");
}
} while (UserInput!="a2");
However when the choice is valid, it is constantly repeating 'This is a valid move' and vice versa for when it's invalid. Can anyone help with this?