I am trying to write an arrayList in a text file with this function:
String ruta = "C:\Users\usuario\Desktop\archivo1.txt";
File f = new File(ruta);
FileWriter fw = new FileWriter(f);
BufferedWriter escritura = new BufferedWriter(fw);
for(int i=0;i<lista.size();i++){
escritura.write(lista.get(i));
escritura.newLine();
}
escritura.close();
}
It's a Arralist
integer that contains the values 0,1,2,3,4
and what appears to me is this
What can be the fault? Can not be done with bufferedWriter?.
Thank you very much.