title: Buffered Reader text file?
body: <p>this is my first post on stack overflow! I'm new to Java and I've recently been experimenting with the Java Buffered Reader for File I/O. I'm getting an exception </p>
  
  <p>Exception in thread "main" java.io.FileNotFoundException</p>
  
  <p>Here is a sample of my code:</p>
  
  <pre><code>System.out.println("Please input an existing filename, otherwise type in 0;");
  fileName = input.nextLine();
  if(fileName.compareTo("0") != 0)
  {
      BufferedReader inFile = new BufferedReader(new FileReader( fileName ) );
  
      firstName = inFile.readLine();
      lastName = inFile.readLine();
      phoneNumber = inFile.readLine();
      while (phoneNumber != null) {
          c1[index] = new Contact(firstName,lastName,phoneNumber);
          index++;
          firstName = inFile.readLine();
          lastName = inFile.readLine();
          phoneNumber = inFile.readLine();
      }
      inFile.close();
  }
  </code></pre>
  
  <p>I've placed my txt file where the .class and .java files are (I'm using the Netbeans IDE). 
  And I type in "namelist.txt" as input for the fileName string.</p>
  
  <p>Am I placing it in the wrong area or am I missing something?</p>