title: Scanner keeps throwing FileNotFound Exception
body: <p>I am trying to load a file called <code>SPY.txt</code> into an array, but I can't even get this little snippet to work.</p>
  
  <p>I don't understand. If <code>f.exists</code> is <code>true</code>, how can the Scanner throw a file not found exception?</p>
  
  <pre><code>import java.io.*;
  import java.util.Scanner;
  
  public class ScannerTest {
      public static void main(String[] args) {
          File f = new File (new File("SPY.txt").getAbsolutePath());
          System.out.println(f.exists());
          Scanner s = new Scanner(f);
      }
  }
  </code></pre>
  
  <p>Output: <code>True</code></p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.RuntimeException: Uncompilable
    source code - unreported exception java.io.FileNotFoundException; must
    be caught or declared to be thrown    at
    scannertest.ScannerTest.main(ScannerTest.java:13)</p>
  </blockquote>
  
  <p>Line 13 is </p>
  
  <p><code>Scanner s = new Scanner(f);</code></p>