title: How do I fix a FileNotFoundException when the program throws an IOException?
body: <p>I was doing a programming assignment that involves reading from a file that contains employee data and am required to write a program that throws an IOException. When I tried to read from the file, which is located in the same folder as the Java file I'm writing, it gave me a FileNotFoundException. Here's my code so far:</p>
  
  <pre><code>import java.util.*;
  import java.io.*;
  public class main {
      public static void main(String[] args) throws IOException {
      // TODO Auto-generated method stub
      Employee[] employees = new Employee[19];
      File infile = new File("employeeData.txt");
      Scanner inputFile = new Scanner (infile); // FileNotFoundException 
      //  thrown here
  }
  </code></pre>
  
  <p>The first few lines of the text file employeeData.txt, which is located in the same folder as my main.java file:</p>
  
  <pre><code>// Type of employee; name; ID
  Hourly;Adam White;200156;12.75;40 // then pay rate; hours
  Salaried;Allan Westley;435128;38500.00 // then annual salary
  Supervisor;Annette Turner;149200;75000.00;5000;435128 614438 435116 548394 // then salary; bonus; ID's of employees who report to her
  </code></pre>
  
  <p>I expected that it would read the text file that I've previewed above as it's in the same folder, but it just gave me a FileNotFoundException.</p>