Private static Scanner Scanner=new Scanner (System. In);
/* *
Used in the interface menu choice, the method reads the keyboard, if the user typed in any of the '1', '4' characters, the method returns,
The return value for the user to type characters,
*/
Public static char readMenuSelection () {
char c;
For (; ; ) {
String STR=readKeyBoard (1);
c=str.charAt(0);
if (c !='1' & amp; & c !='2' & amp; & c !='3' & amp; & c ! {
='4')System. The out. Print (" choose wrong, please input again: ");
}
The else {
break;
}
}
Return the c;
}
}
CodePudding user response:
The