I have some code that writes my array list to a file in this format.
[bob, jill]
However i need it to be saved in this format.
bob
jill
My current code is
public void saveCusNa() throws FileNotFoundException {
//for testing##########
name.add("bob");
name.add("jill")
//##################
String tmp = name.toString();
PrintWriter pw = new PrintWriter(new FileOutputStream("nameCus"));
pw.write(tmp);
pw.close();
}
Any suggestions as I can't set up any sort of loop that works for me.