Длина символа всегда равна 1, я полагаю, вы могли бы достичь того, что вам нужно, с помощью
public static char promptForChoice(Scanner in) {
if(in.next() == "H" || in.next() == "L" || in.next() == "S") {
System.out.println("High, Low or Seven(H/L/S");
return (char) in.next();
}
else {
System.out.println("You must enter only H, L or S.");
// you must always have a return value, in this case
//e.g. the automatically initialized char value
return '\0';
}
}
с помощью своего кода вы могли бы сделать что-то вроде
public static char promptForChoice(Scanner in) {
System.out.println("High, Low or Seven(H/L/S");
char sel = in.next().charAt(0);
if(in.next().length == 1) {
sel = Character.toUpperCase(sel);
int i = 1;
while (i != 0) {
System.out.println("High, Low or Seven(H/L/S");
if (sel == 'H' || sel == 'L' || sel == 'S') {
i = 0;
} else {
System.out.println("You must enter only H, L or S.");
i = 1;
}
}
}
else System.out.println("You must enter only one single character");
return sel;
}