title: Is there a way to record a highscore, Java
body: <pre class="lang-Java prettyprint-override"><code>static int score = 0;
  
   public static void score(){
      score +=1;
  </code></pre>
  
  <p>OK this is the code that runs every time you score a point, my question is is there a way to record the highest score, so say you get a score of 10 i want to display that score in the top right with some text that says high score: . Also got one more question, just tried out the code and it works but is there a way to keep the numbers for the next time the game runs, whenever i close the application and then re-run it it resets the high score to 0, is there a way to keep it or not?</p>