I had written a small program to read a file(sample.txt). I placed both the program and txt file in the bin directory of the j2sdk1.4.2_04 and having been trying to compile it from the command line.
The error which has been nagging me for a while.....
UNREPORTED EXCEPTION FILE NOT FOUND EXCEPTION
The source code.....
import java.io.*;
public class SimpleTok {
public static void main(
String[] args) {
BufferedReader buff = new BufferedReader(new FileReader("sample.txt"));
boolean eof = false;
try {
while(!eof) {
String line = buff.readLine();
if(line == null)
eof = true;
else {
System.out.println(line);
}
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
Thanks!!!
Adi