-
Java code
-
File f = new File("c:/1.txt"); if(!f.exists()){ try { f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } }
-
Java code
-
File file = new File("c:\\123\\123.txt"); if(!file.getParentFile().exists()) file.getParentFile().mkdirs(); file.createNewFile();
-
Java code
-
File f = new File("D:/1.txt"); if(!f.exists()){ try { f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } }
-
Java code
-
File file = new File("c:\\123\\123.txt"); if(!file.getParentFile().exists()) file.getParentFile().mkdirs(); file.createNewFile();