Home > Back-end >  Can't find the symbol (readKeyBoard (1); )
Can't find the symbol (readKeyBoard (1); )

Time:09-20

Public class Utility {
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
reference face the building Lord reply:


Have never see readKeyBoard method body!

CodePudding user response:

To tell the truth, you have a problem the second line
Scanner class why want to use private and static to modify?
  • Related