Skip to content

Instantly share code, notes, and snippets.

@matiasfha
Created October 1, 2013 20:02
Show Gist options
  • Save matiasfha/6784244 to your computer and use it in GitHub Desktop.
Save matiasfha/6784244 to your computer and use it in GitHub Desktop.
ejemplo java escritura archivo texto
try{
FileWriter fw = new FileWriter("salida.txt");
BufferedWriter bw = new BufferedWriter(fw);
PrintWriter salida = new PrintWriter(bw);
salida.println("Primera linea");
salida.close();
//Modo append
bw = new BufferedWriter(new FileWriter("salida.txt",true));
salida.print("Segunda Linea");
double b = 123.45;
salida.prinln(b);
salida.close();
}catch(java.io.IOException e){}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment