Hello, I have a char variable that is supposed to contain either a Y,y,n or N character, I want to test if it does not contain it, then display an error message and exit the program.
This is the code I am using;
if (userDecision != 'Y' || userDecision != 'y' || userDecision != 'n' || userDecision != 'N')
{
System.out.println("Error: invalid input entered for the interstate question");
System.exit(0);
}
Irregardless of what is in the variable it always returns true and executes the command to exit the program, what am I doing wrong?