title: FileNotFoundException Java
body: <p>I'm trying to make a simple highscore system for a minesweeper game.  However i keep getting a file not found exception, and i've tried to use the full path for the file aswell. </p>
  
  <pre><code>package minesweeper;
  
  import java.io.*;
  import java.util.*;
  
  public class Highscore{
  
   public static void submitHighscore(String difficulty) throws IOException{
    int easy = 99999;
    int normal = 99999;
    int hard = 99999;
    //int newScore = (int) MinesweeperView.getTime();
    int newScore = 10;
    File f = new File("Highscores.dat");
  
    if (!f.exists()){
     f.createNewFile();
  
    } 
    Scanner input = new Scanner(f); 
    PrintStream output = new PrintStream(f);
  
    if (input.hasNextInt()){
     easy = input.nextInt();
     normal = input.nextInt();
     hard = input.nextInt();
    }
  
    output.flush();
  
  
  
    if(difficulty.equals("easy")){
     if (easy &gt; newScore){
     easy = newScore;
     }
    }else if (difficulty.equals("normal")){
     if (normal &gt; newScore){
     normal = newScore;
     }
    }else if (difficulty.equals("hard")){
     if (hard &gt; newScore){
     hard = newScore;
     }
    }
    output.println(easy);
    output.println(normal);
    output.println(hard);
  
   }
  
  //temporary main method used for debugging
  
   public static void main(String[] args) throws IOException {
    submitHighscore("easy");
   }  
  
  }
  </code></pre>