title: Where do I put a text file when using command line or Eclipse
body: <p>I am working on a project for school in which the user must input the name of a text file (QuizScores.txt in this case). Then I must validate that it exists or not. I have this part figured out. However when I was using Eclipse it couldn't find the file. I decided to try just using a command line but I'm not sure where to put my text file so that it will find it. I'm supposed to have the text file in a place where the user only needs to type in the name to find it. Thank you very much.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    public static String fileValid(Scanner s, String fileName, String validateFile, boolean valid) throws FileNotFoundException
  {
      do
      {
          valid = false;
          System.out.println("Enter name of quiz file (i.e. QuizScores.txt): ");
          fileName = s.nextLine();
          Scanner inFile = new Scanner (new File(fileName));
  
          if (!inFile.exists())
          {
              System.out.println("Error! File does not exist");
          }
          else
          {
          valid = true;   
          }
      }while(valid == false);
      return fileName;
  }
  </code></pre>