Ive been trying to use the FileReader class to open a file called input.in, but it can't find the file. It is located in the same directory as my java file, is this where it should be?
Im using code like this:
FileReader fr = new FileReader ("input.in");
10-21-2004, 09:05 PM
Kram
show us the error please, also you may want to read this site about reading in files:
yea i actually looked at both of those articles when i was trying to write the code to open the file. Here is the error:
Unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
FileReader fr = new FileReader ("input.in");
And then there is a arrow/hat pointing to the n on new.
Here is my code if it helps:
PHP Code:
import java.io.*;
class ride {
public static void main(String args[])
{
FileReader fr = new FileReader("input.in");
BufferedReader br = new BufferedReader(fr);
String record = null;