I get a runtime exception when I execute the following code. I cannot see what is wrong.
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintWriter;
public class FileIO {
public static void main(String[] args){
File test = new File("test.txt");
FileOutputStream ostream = new FileOutputStream(test);
PrintWriter out = new PrintWriter(ostream);
}
}
I keep getting a FileNotFoundException. I have tried keeping the file in every possible folder within the project and also tried giving an explicit path, but I keep getting the same exception. Any ideas?