你能幫我找出我錯過了下面的代碼嗎?我正在使用Eclipse。字符串和||陳述
Scanner scanner = new Scanner(System.in);
String input = scanner.nextLine();
{
if (input.equalsIgnoreCase(("front door") || ("front") || ("basement") || ("basement entrance")))
if (input.equalsIgnoreCase(("front door") || ("front"))
System.out.println("Maggie went to the side of the home and open the basement door. As the door opened, she could smell the dust from inside.");
else
if ((input.equalsIgnoreCase("basement") || ("basement entrance")))
System.out.println("Maggie walks up the steps and slowly opens the front door.");
else
System.out.println("That is not a correct answer");
使用'{}'你IFS是明確其是否具有其他.. –
上的兩邊的操作數||運算符必須具有布爾值true/false。他們不是更早的函數調用的附加可能性。 –