I am trying to create a method for some options that a user my have. If the user will input s, f or q some actions will happen but I have an issue with comparison in while conditions. So basically while option is not equal to s,f or q this method will keep on prompting the error message and will ask the user to input an option. I tried to use the bellow code but it keeps on saying that the selection is invalid even if I input s,f
public String options(){
System.out.println("Options: (s)elect a floor, (f)ire alarm, (q)uit");
String option= read.next();
while(!option.equalsIgnoreCase("select") || !option.equalsIgnoreCase("fire") || !option.equalsIgnoreCase("quit")){
System.out.println("Invalid selection!");
System.out.println("Options: (s)elect a floor, (f)ire alarm, (q)uit");
option= read.next();
}
return option;
}//end options