FileNotfound exception in simple java code
<p>I'm using this code to read a file in java using the filereader object. However the application throws an exception stating that it is not able to find the file.Can anyone help this novice guy just into java programming</p>

<pre><code>import java.util.*;
import java.io.*;
import java.util.Scanner;
import java.io.FileReader;
import java.io.PrintWriter;


public class CFileReader {

    /**
     * @param args
     */
    public static void main(String[] args)  throws FileNotFoundException
    {
        String objLine;
        String strInputFileName;
        FileReader objReader = null;
        Scanner objScanner;
        File objFile;

        if(args.length &gt; 0)
        {
            for(int i = 0;i &lt; args.length ;i++)
            {
                //Gets the arguments into the strInputFileName variable
                strInputFileName = args[i];

                System.out.println("Filename entered was : " + strInputFileName);

                //Create a file object which points to the filename i.e strInputFileName 
                objFile = new File(strInputFileName);

                //Create a FileReader object with the File object i.e objFile as the input parameter
                objReader = new FileReader(objFile);

                System.out.println("Filereader object is : " + objReader.toString());

                //Create a scanner object with FileReader as input parameter
                objScanner = new Scanner(objReader);

                System.out.println(args);


                //Scans the file if it has next line
                while(objScanner.hasNextLine())
                {
                    //Store the contents i.e. first line in the objLine Variable
                    objLine = objScanner.nextLine();


                    //prints the contents
                    if(objLine.indexOf(i) &gt; 0)
                        {
                            System.out.println(objLine);
                        }
                }


            }

        }
        else
        {
            //Warn the user to enter the command line arguments if he has not entered
            System.out.println("Please Enter Command line args");
        }

    }

}
</code></pre>

<p>To compile the program i use </p>

<pre><code>javac CFileReader.java
</code></pre>

<p>and to run </p>

<pre><code>java CFileReader "C:\\Hello.txt"
</code></pre>

<p>where <strong>Hello.txt</strong> is a simple text file with some contents</p>

<p>Thanks a lot in advance</p>
