Make a backup file: Difference between revisions

→‎{{header|Java}}: Fixed compilation errors in Java 7+ version.
(→‎{{header|Java}}: Fixed compilation errors in Java 7+ version.)
Line 206:
 
=={{header|Java}}==
{{incorrect|Java|Compile errors.}}
{{works with|Java|7+}}
<lang java5>import java.io.PrintWriterFile;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.*;
 
public class Backup {
public static void saveWithBackup(String filename, String... data){
throws IOException {
//toRealPath() follows symlinks to their ends
Path file = Paths.get(filename).toRealPath();
Line 232 ⟶ 234:
}
}</lang>
 
{{works with|Java|1.5+}}
<lang java5>import java.io.File;
9,492

edits