title: Reading a file using FileReader and Scanner
body: <p>I am a Java beginner and have read similar questions but still I dont get why my code is showing a FileNotFound Exception.
  My file is in the same directory.</p>
  
  <p>My code is:</p>
  
  <pre><code>import java.io.*;
  import java.util.Scanner;
  
  public class reader {
      public static void main(String[] args) { 
          Scanner in = new Scanner(System.in);
          int x = in.nextInt();
          double y = in.nextDouble();
          float g = in.nextFloat();
          String a = in.next();
          File file = new File("v.txt");
          System.out.println(x + "" + y + "" + g + "" + a); 
          Scanner inFile = new Scanner(new FileReader(file));
          String u = inFile.nextLine();
          System.out.println(file.getAbsolutePath());
          System.out.println(u);
      }
  }
  </code></pre>
  
  <p>Error is:</p>
  
  <pre><code>17: error: unreported exception FileNotFoundException; must be caught or declared to be thrown
       Scanner inFile = new Scanner(new FileReader(file));
                                    ^
  1 error
  </code></pre>