-6
当我的应用程序编译,它不会接受在它问:“请输入一个房间搜索:”同线roomNum
输入为什么扫描仪不能接受println上的输入?
System.out.println();
if(roomNum < 0);
{
System.out.println("Please enter a room to search for: ");
roomNum = input.nextInt();
}
如果我只是用next
代替nextInt
,它不能正确编译。
上面的代码工作,但不会接受同一行上的输入,这是我需要的功能。
删除'if'行上的分号。 – rgettman