I just typed the following simple program which gets an userinput to the variable inData. Then the input is checked for having typed "x" or not. For me, the if statement should work, but the program always says "You have not typed x!" even when typing x.
Use !inData.equals("x") and inData.equals("x") instead of inData != "x" and inData == "x". Strings are objects, and with != and == you're comparing references, not String contents. That's what equals does.