I am having an issue, i need to scan different inputs that the user will insert on the screen at the same time. For example i have a sort of a menu that is printed on the screen and the user will select if he wants to load a file and type the name of file.I have done this by asking the user to type load and after that asked him what file to load by I need it to be done at the same time. The user just types "load S.txt" and it selects the loads option and opens the file at the same time.My professor told me I am supposed to use token but I'm stuck.(in java) Thanks .
private static void inspecting (){
System.out.println("inspect word or byte?");
Scanner input3 = new Scanner( System.in );
String insp = input3.next();
if(insp.equals("word")){
System.out.println("select the adrress you want to inspect the value");
Scanner input4 = new Scanner( System.in );
int addr = input4.nextInt();
what i need is the user to type "ispect word at adrress x" withou doing it step by step.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…