I am coding a simple program using a scanner and now want to make sure the user only types "yes" or "no" by comparing the input to these words. I'm using a normal if
-statement with ||
(pipes):
if (!input.equals("yes") || !input.equals("no")) {
//do something
}
Java (I am using BlueJ) complains about my pipes, it says: "illegal character: '\u00a0'"
What I tried
- I copied & pasted pipes from the wikipedia site to make sure I am really using correct pipe-characters
- restarted BlueJ
- tried using equal signs (&&), same error
- if I removed the second condition and the pipes it works
Does anyone have an idea why it complains and how I can fix it? – Thanks in advance