how can i create a new ".txt" file in java netbeans without overwriting the previous saved file?
here is my code, i used the method of setting a filename because i don't know yet how to create a new .txt file and not to overwrite the previous one
File file = new File("Basic Student Information.txt");
try {
Files.write(Paths.get("Basic Student Information.txt"),list);
Scanner scan = new Scanner(file);
//while(scan.hasNext()){
// JOptionPane.showMessageDialog(null,scan.nextLine());
//}
} catch (IOException ex) {
Logger.getLogger(StudentInfo.class.getName()).log(Level.SEVERE, null, ex);
}