I’m trying to get my program to save the output to a file for debugging purposes. The problem is, it compiles without any errors while not creating a file anywhere to be seen. This is probably something very simple but I can’t figure it out, haven’t coded in Java in a while.
public static void main(String[] Args) {
FileOutputStream out = null;
try {
out = new FileOutputStream("out.txt");
} catch (FileNotFoundException e) {
e.printStackTrace();
}
PrintWriter ps = new PrintWriter(out);
for (int l = 1; l < 1001; l++) {
ps.println((translation(makeString(l))));
System.out.println((translation(makeString(l))));
}
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Thanks in advance!
If you are running this code in eclipse, search in the
workspace/projectfolder, you should find one there