Java File创建文件夹及文件
@Test public void testFile(){ File file = new File("E:\code\hello"); File file1 = new File(file,"hello.txt"); if(!file.exists()){ file.mkdir(); //创建文件夹 try { file1.createNewFile();//创建文件 } catch (IOException e) { e.printStackTrace(); } System.out.println("-------file create---------"+file1.getAbsolutePath()); } }
上一篇:
多线程四大经典案例
下一篇:
一起自学SLAM算法:4.3 相机