title: How to restart a program from a method
body: <p>I'm a beginner in Java and I am making a basic game for practice. I'm almost done, but I have one further obstacle to overcome. </p>
  
  <p>I would like to know how to make the game loop on the <code>game()</code> method after pressing <em>no</em> as a choice when asked whether to end the game.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>private static void game() //game method
  {
      //...
  
     int play = JOptionPane.showOptionDialog(null
                     ,"End"
                     , "Do you want to play again?"
                     , JOptionPane.PLAIN_MESSAGE
                     ,JOptionPane.DEFAULT_OPTION
                     , null
                     , again
                     , again[1]);
     //end of game
  
      if (play == 0)
          System.exit(0);//exit
      else
           /* what do I put here to restart the program in the same method(game()) 
              after pressing the No button on the JOptionPane???    */        
           System.out.println("Service not available");  
  </code></pre>
  
  <p>To anybody who can help, I thank you very much!</p>