我的java程序,下面显示的部分,似乎停留在if("".equals)行.while循环继续,尽管if语句中的选项不会最终运行.因此,不是打印出新数据(在else下)或打印出信息(在默认情况下),它只是不断要求新的输入.
System.out.println("Type in government type. Enter '?' and click enter for list of gov types.");
while(playerSelection==false);
{
input = fileinput.nextLine();
if("?".equals(input))
{
System.out.println("despotic_monarchy, administrative_monarchy, constitutional_monarchy, despotic_monarchy, enlightened_despotism, feudal_monarchy, revolutionary_empire\n"+
"administrative_republic, beauracratic_despotism, constitutional_republic, republican_dictatorship, merchant_republic, noble_republic, revolutionary_republic\n"+
"papal_government\n"+
"steppe_horde, tribal_democracy, tribal_despotism, tribal_federation");
}
else
{
fileLines[lGov[nationSelected]] = " " + input;
System.out.println(fileLines[lGov[nationSelected]]);
playerSelection=true;
}
}
Run Code Online (Sandbox Code Playgroud)