int it_number = 1;
public void write() throws IOException {
       StringBuffer sb = new StringBuffer(name);
       sb.append(it_number);
       System.out.println(sb); 
       it_number++;
      File file = new File(sb + ".txt");
      file.createNewFile();
      FileWriter writer = new FileWriter(file);
      writer.write(results[0] + " " + results[1] + " " + velocity + "\n"     );
     writer.flush();
     writer.close();
    }
}
The String 'name' is a user input. And the iteration number 'it_number' is supposed to increment every time the same user repeats this with the same so I can a few different files with the same name. But this keeps rewriting the file over and over. What can I do to make each iteration different?
 
     
    