title: How to specify a text file in the command line
body: <p>I am trying to create a program that reads from a text file. I use <code>cmd</code> and type in <code>javac fileName.java</code> to compile, then <code>java -cp . fileName</code> to run it. However, I want to run the program by writing <code>java fileName textInput.txt</code>. I have already created the program; but I have to specify the name of the text file in the code. </p>
  
  <p>I was told that <code>args[0]</code> should be the name of the text file, but I am not sure how to implement this.</p>
  
  <p>I have not posted my code, but tell me if I need to.</p>