here is the code that calls a method if input is yes and says invalid selection if input is anything else.
private static void continueyn()
{
String option;
Scanner input = new Scanner(System.in);
System.out.println("Continue using program? type in yes or no");
option = input.nextLine();
if (option == "yes" || option == "Yes" || option == "YES" || option == "Y" || option == "y")
{
printmenu();
menusystem();
}
else
{
System.out.println("Invalid answer");
}
}
However, whenever i type yes,y,fdjs,f fisj, bascically anything, it says "invalid selection".
I am trying to make a menu system that continues after using the method but i dont know how to make it the right way so that is why i am using this function and putting it under every switch case method.