I'm having trouble with writing to a txt file. I am getting a FileNotFound Exception, but I don't know why because the file most definitely is there. Here is the code.
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.File;
public class Save
{
public static void main(String[] args)
{
File file = new File("C:/Users/Daniel/Desktop/Programs/Save Data Test/save.txt");
PrintWriter pw = new PrintWriter(file);
pw.println("Hello World");
pw.close();
}
}