title: Program catches FileNotFoundException even though the file is in the correct directory
body: <p>I am writing a program for my CS class and I have to read the text from the data.txt file and if, for whatever reason that file is not there, I am supposed to throw an IOE exception and print out &quot;File not found&quot;.</p>
  <pre><code> try{
      Scanner in = new Scanner(new File(&quot;data.txt&quot;));
      String temp;
      int n = 0;
      ...
  </code></pre>
  <p>and</p>
  <pre><code>catch(FileNotFoundException e){
      System.out.println(&quot;File not found&quot;);
  }
  </code></pre>
  <p>but when I run the program, all I get is the &quot;File not found&quot; but the data.txt file is in that folder along with the java program file. Can anyone please help me with how I can make the program see the data.txt file</p>