无法跳出while循环。我的代码有什么问题? 一切看起来正确的逻辑我:Java - 无法跳出循环
虽然(而不是 's' 或不是 'P') ---打印线: “重新” --- ReadInput:
while (!answerInput.equals("s") || !answerInput.equals("p"))
{
System.out.print("Wrong Input. Type S for Sum or P for Product: ");
answerInput = userInput.next();
answerInput = answerInput.toLowerCase();
}
请指教。
如果你会说*当(不是 's' 或 'P')*你的错误是可以理解的。但是,如何(而不是'或'不'')有什么意义? – shmosel