how to have program continue to menu after game ends
<p>I'm doing a Java program (using classes within a class) and I'm stuck at a point in my game menu. After the game finishes in "case 2" I would like the program to go back to the menu instead of exiting. I have removed any exit statements from my <code>DieGame</code> and the other classes obviously do not have any exit statements. If you need more clarification in order to help please feel free to ask!</p>

<pre><code>import java.io.IOException;
import java.util.Scanner;

public class Game1 {
  public static void main(String[] args) throws IOException {
    Scanner in = new Scanner (System.in);
    DieGame game = new DieGame();
    Date2   date = new Date2();
    Time    time = new Time();
    int gameMenuChoice;

    do {
      System.out.println("\nEnter player information: Press 1 ");
      System.out.println("Play the game: Press 2 ");
      System.out.println("Update top player information: Press 3 ");
      System.out.println("Display top player: Press 4 ");
      System.out.println("Quit: Press 5 ");
      System.out.print  ("Enter choice: ");

      gameMenuChoice = in.nextInt();

      switch (gameMenuChoice) {
        case 1: game.playerName(); 
          date.setYear();
          date.setMonths();
          date.setDay();
          time.setHours();
          time.setMinutes();
          time.setSeconds();
          time.timeOfDayCode();
          break;

        case 2:
          game.playGame();
          break;

        case 3:
        case 4:
          game.displayName();
          date.displayDate();
          time.displayTime();
          break;

        case 5:
          System.out.print("\nThank you for playing..Goodbye");
          System.exit(0);
          break;

        default:System.err.print("PLEASE ENTER A NUMBER BETWEEN 1-5\n");
      }
    } while (gameMenuChoice != 5);
  }
}
</code></pre>

<hr>

<pre><code>import java.util.*;

public class DieGame {

    private String playername;
    private int pot;

    public DieGame() {
        playername = new String();
    }

    public String playerName() {

        Scanner in = new Scanner (System.in);
        System.out.println("\nEnter your name: ");
        playername = in.nextLine();

        return playername;}




    public void playGame() {

    Scanner input = new Scanner (System.in);
    Random randomNumbers = new Random();


    int pot = 100;
    int bet = 1;    
    int die1, die2;
    int sum;

    while(bet != 0) {
        System.out.print("\nCurrent pot is $" + pot + " enter your bet amount (0 to quit):$");
        bet = input.nextInt();

        if(bet == 0){
            System.out.print("\nYou end the game with $" + pot);
            }

        else {
            while ( bet &gt; pot || bet &lt;0){
                if (bet &gt; pot){
                    System.err.print("Invalid wager. Please enter new bet:$");
                    bet = input.nextInt(); }

                    else if (bet &lt; 0){
                        System.err.print("Invalid wager. Please enter new bet:$");
                        bet = input.nextInt();}
            }


            die1 = randomNumbers.nextInt(6) + 1; // first die
            die2 = randomNumbers.nextInt(6) + 1; // second die

            sum = die1 +die2; //sum of die values

            System.out.printf("You rolled %d and %d " , die1, die2);

            if(die1 == die2 ){
                pot = (bet*2) + pot;
                System.out.println("\nYou win double!!");
            }

            else if(sum &lt;= 5 || sum == 10 || sum == 12){
                System.out.println("\nYou stay even!");
            }

            else if(sum == 7 || sum == 11){
                pot = pot + bet;
                System.out.println("\nYou win!");
            }

            else if(sum == 6 || sum == 8 || sum == 9){
                pot = pot - bet;
                System.out.println("\nYou lose!");
            }

            if (pot == 0){
                System.out.print("\nYou end the game with $0"); 

            }

        }
    }
}
    public void displayName() {
        System.out.println("\nTop player is: " + playername +" with a score of:$" + pot);
        }

} // end class DieGame1
</code></pre>
