I am having trouble with returning to the main menu.
public static void main(String[] args)
{
Project4 app = new Project4();
//Display all Menu options
app.displayMenus();
//Asks user to pick a menu option
System.out.println("Please choose a menu option:");
int option = keyboard.nextInt();
while(option >=1 || option <= 5)
{
if(option == 1)
{
app.menu1();
app.displayMenus();
System.out.println("Please choose a menu option:");
option = keyboard.nextInt();
}
if(option == 2)
{
app.menu2();
app.displayMenus();
System.out.println("Please choose a menu option:");
option = keyboard.nextInt();
}
else if(option == 3)
{
app.menu3();
System.out.println("Press enter to return to the menu.");
String enter = keyboard.nextLine();
}
So the statement else if(option == 3) is supposed to display my menu3() method which displays information to the user. I am trying to get it to press enter to return to the main menu which is called with the method app.displayMenus(). I have tried the loops, but I just don't know what to put after String enter = keyboard.nextLine() to get it to the main menu and start the process over again. Any help would be appreciated. Thanks!