Ho provato ad utilizzare il seguente codice per determinare se un file esiste, purtroppo mi dice cannot resolve symbol method exists()...potete aiutarmi? Thanx.
import java.io.*;
class Output {
public static void main(String args[]) {
try {
int n = 0;
String filename = new String("Output " + n + ".txt");
while (filename.exists() == false) {
n++;
}
PrintWriter out = new PrintWriter(new FileWriter("filename"));
out.print("test writing");
out.close();
}
catch(Exception e) {
System.err.println("ERROR: " + e);
}
}
}