title: Highsocre to text file
body: <p>I'm trying to write a high score for my program to a text file. I have this code and it is working;</p>
  
  <pre><code>if(gameOver == true){
          int highscore = score;
      String username = "Jay";
  
  
  
      try {
  
          String content = username;
  
          File file = new File("highscore.txt");
  
  
  
          FileWriter f = new FileWriter(file.getAbsoluteFile());
          BufferedWriter b = new BufferedWriter(f);
          b.write(content + "\t" + "Score: " + highscore);
  
          b.close();
  
          System.out.println("Score Saved");
  
      } catch (IOException e) {
          e.printStackTrace();
      }
      }
  </code></pre>
  
  <p>But every time I restart the game the high score gets overridden. How would I make it so that it writes to the next line and is there a way to sort it by highest score?</p>
  
  <p>Thanks
  Jay </p>