Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot find symbol constructor for FileReader

807599Nov 8 2006 — edited Nov 9 2006
"cannot find symbol constructor FileReader(java.lang.String)" Is the exact error message I receive when compiling. I am offering 10 duke dollars to the first person to help me fix it.
// UIL Computer Science
// Reads from a file

import java.io.*;

public class FileReader
{
    public static void main(String args[])
    throws IOException
    {
        BufferedReader file = 
            new BufferedReader(new FileReader("JavaFileReaderTest.dat"));   // Sets up the reader object which opens the specified file
            
        String inString;
        
        while((inString = file.readLine()) != null)                         // While it's not the end of the file
        {
            System.out.println(inString);
        }
        
        file.close();                                                       // Closes the file
    }
}
Message was edited by:
Adamski
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2006
Added on Nov 8 2006
11 comments
1,215 views