Skip to content

Instantly share code, notes, and snippets.

@NrI3
Created June 19, 2015 18:54
Show Gist options
  • Save NrI3/c56b4bfee95331c1742e to your computer and use it in GitHub Desktop.
Save NrI3/c56b4bfee95331c1742e to your computer and use it in GitHub Desktop.
[ Java ] Guardar datos en un archivo
private static void writeToFile(String fileName){
try{
FileWriter file = new FileWriter(fileName);
BufferedWriter buffer = new BufferedWriter(file);
String[] datos = new String[]{"Uno","Dos","Tres","Cuatro"};
for(String dato : datos){
buffer.append(dato);
buffer.newLine();
}
buffer.close();
}
catch(Exception e){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment