import java.io.*; public class A { public static void main(String[] args) throws Exception { File f = new File("c:\\test.txt"); f.createNewFile(); System.out.println(f.exists()); } } ### c:\desktop> javac *.java && java A true Process javac exited with code 0