import java.io.File; import java.io.IOException; public class CreateFile { public static void main(String args[]) { File file = new File("c:\\work\\test"); try { if (file.createNewFile()) { System.out.println("Created OK"); } else { System.out.println("Created Wrong"); } } catch (IOException e) { e.printStackTrace(); } } }