else if (answer.equals("check value")){
System.out.println("Of what?");
System.out.println("Tax, Donations, Income, Profit, Expenditure, Services, Military, City or Economy.");
System.out.println("Do not use caps and spell it correctly otherwise it will not be recognised.");
String valueToCheck = scan.nextLine();
if (valueToCheck == "tax"){
System.out.println(tax);
}else if (valueToCheck == "donations"){
System.out.println(donations + "donations per turn");
}else if(valueToCheck == "income"){
System.out.println(incomePerTurn + " income per turn");
}else if(valueToCheck == "profit"){
System.out.println(profitPerTurn + " profit per turn");
}else if(valueToCheck == "expenditure"){
System.out.println(expenditurePerTurn + "expenditure per turn");
}else if(valueToCheck == "services"){
System.out.println(servicesBudget + " to services budget");
}else if(valueToCheck == "military"){
System.out.println(militaryBudget + " to military budget");
}else if(valueToCheck == "city"){
System.out.println(cityBudget + " to cities budget");
}else if(valueToCheck == "economy"){
System.out.println(economy + " to total economy");
}
newTurn();}
你好,每当我运行我的程序并输入“检查值”时,我都没有收到任何错误,实际上我什么也没得到。我只是想知道为什么什么都没有返回。谢谢你的帮助!