title: Cannot find symbol File
body: <p>I'm working on a course project and using this code block my professor gave us to, one, get all files from the current directory and, two, to find which files are in the .dat format. Here is the code block:</p>
  
  <pre><code>// Get all files from directory
  File curDir = new File(".");
  String[] fileNames = curDir.list();
  ArrayList&lt;String&gt; data = new ArrayList&lt;String&gt;();
  
  // Find files which may have data. (aka, are in the .dat format)
  for (String s:fileNames)
      if (s.endsWith(".dat"))
          data.add(s);
  </code></pre>
  
  <p>However, when I try to compile and test my program, I get this error message in response:</p>
  
  <pre><code>Prog2.java:11: cannot find symbol
  symbol  : class File
  location: class Prog2
     File curDir = new File(".");
     ^
  Prog2.java:11: cannot find symbol
  symbol  : class File
  location: class Prog2
     File curDir = new File(".");
                       ^
  </code></pre>
  
  <p>I admittedly have minimal experience with the <code>File</code> class, so it might be my fault entirely, but what's up with this?</p>