title: error: exception java.io.FileNotFoundException
body: <p>Can anyone tell me why I have this error: exception java.io.FileNotFoundException is never thrown in body of corresponding try statement.
  I try to save text from a file in an ArrayList.     </p>
  
  <pre><code>import java.io.*;
      import java.util.*;
  
      public class EditMembership
      {
          public static void main(String[] args) throws java.io.FileNotFoundException
          {
  
              ArrayList&lt;String&gt; member = readFromFile("database.txt");
              System.out.println(Arrays.toString(member.toArray()));
          }
  
          public static ArrayList readFromFile(String fileName) throws java.io.FileNotFoundException
          {
  
              Scanner x = new Scanner(new File(fileName));
              ArrayList&lt;String&gt; memberList = new ArrayList&lt;String&gt;();
              try {
                  while (x.hasNextLine()) 
                  {
  
                      memberList.add(x.nextLine());
                  }
                  x.close();
              }
              catch(FileNotFoundException e)//here is the error
              {
                  e.printStackTrace();
              }
              return memberList;
          }
      }
  </code></pre>