Hi I'm a beginner of Java lauguage.
It seems like my computer does not recognize FileReader at all.(Random class does not work either.) I typed the exact same code in a different computer and it worked. I uninstalled JDK and reinstalled it, but still doesn't work. I don't know what to do.
My environment
Samsung Netbook N150 plus. /// windows 7 starter/// java(1.6_21 standard edition) /// jGrasp(1.8).
Here is my code.
import java.io.*;
import java.util.*;
public class FileReaderGG
{
public static void main(String[] args)throws Exception
{
FileReader infile = new FileReader("todolist.txt");
Scanner indata = new Scanner(infile);
while (indata.hasNextLine())
{
System.out.println(indata.nextLine());
}
infile.close();
}
}
It gives me errors saying "cannot find symbol"
Looks like this FileReaderGG.java:11: cannot find symbol symbol : constructor FileReader(java.lang.String) location: class FileReader FileReader infile = new FileReader("todolist.txt");
5 more errors are there. I spent a whole day trying to figure out what the problem is. Please help me out.