if ((clearance.equals("")) || (!clearance.equals("0")) || (!clearance.equals("1"))){
System.out.println("Invalid entry, exiting.\n");
System.exit(0);
}
However when I key in 0 or 1 it still prints “Invalid entry, exiting.”
Any idea what went wrong?
The condition should read:
Your current expression always evaluates to
true(since any string is not equal to either “0” or “1”).