I'm trying to ask a user whether they want to encrypt or decrypt a message, and I know that I need to use userInput.equals("encrypt")
, but i want to use a while loop with !=.
while(userInput.!equals("encrypt") || userInput.!equals("decrypt")){
System.out.println("Please try again. Check spelling, and that you typed either 'encrypt' or 'decrypt'.);
userInput = scan.nextLine().toLowerCase();
}
and I dont know the syntax for the userInput.!equal("x")
. (Obviously, what I put is not right).