title: Restart game in java using y/n?
body: <p>how do you restart game in java?</p>
  
  <p>this is what i tried but did not work:</p>
  
  <pre><code>String playagain;
      String y="y";
      String n="n";
  </code></pre>
  
  <p>//there is a huge chunk of code that goes in here for the game</p>
  
  <pre><code>System.out.println("play another game?(y/n)");
      playagain=input.next();
      if(playagain==y){
          Game.end();
          Game.start();
      }else if(playagain==n){
          System.out.println("Goodbye");
      }
  </code></pre>
  
  <p>game is the name of the class, but it insists i create a method for that to work.
  would anyone know an easier way to restart the game when player clicks y?
  Any help is appreciated</p>