reading filename through command line argument
<p>I came across the following code in a book recently. It says that we can reference a file for instance that we want to read by writing a command line like the first line below. However it is throwing an error with this line. Can someone please advise as I have never come across this before?</p>

<p>Thanks</p>

<pre><code>java ShowFile c:/Users/Bosra/Desktop/Sample.txt
import java.io.*;


public class ShowFile
{
public static void main(String args[])
{
    int i;
    FileInputStream fin;

    //first confirm that a filename has been specified
    if(args.length!=1)
    {
        System.out.println("Usage:ShowFile Filename");
        return;
    }
}
}
</code></pre>
