Facebook
From Thundering Flamingo, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 45
  1. import java.io.BufferedWriter;
  2. import java.io.File;
  3. import java.io.FileWriter;
  4. import java.io.IOException;
  5.  
  6. public class Main {
  7.  
  8.     public static void main(String[] args) throws IOException {
  9.  
  10.             File archivo;
  11.         archivo = new File("Escribir.txt");
  12.  
  13.         if(archivo.exists()){
  14.  
  15.             FileWriter fwescribir = new FileWriter(archivo,true);
  16.             BufferedWriter bwescribir = new BufferedWriter(fwescribir);
  17.             bwescribir.append("Hola como estas");
  18.         }
  19.         else {
  20.             System.out.println("No existe el archivo");
  21.         }
  22.  
  23.  
  24.     }
  25. }
  26.