Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. import java.io.File;
  2.  
  3.  
  4. public class Writer1 {
  5.    
  6.     public static void main(String[] args) {
  7.        
  8.        
  9.         try {
  10.             boolean newFile = false;
  11.             File file = new File("meuArquivo.txt");
  12.            
  13.             System.out.println(file.exists());
  14.             newFile = file.createNewFile();
  15.             System.out.println(newFile);
  16.             System.out.println(file.exists());
  17.            
  18.        
  19.         } catch(Exception e){}
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement