/* * Main.java * * Created on January 10, 2011, 4:24 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package file; import java.io.File; import java.io.IOException; /** * * @author ocamposm */ public class CreateFile { /** Creates a new instance of Main */ public CreateFile() { } /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { // TODO code application logic here File f; f=new File("myfile.txt"); if(!f.exists()){ f.createNewFile(); System.out.println("New file \"myfile.txt\" has been created to the directory"); } } }