JAVA 如果文件夹不存在创建新的文件夹

mac2026-05-17  5

if (!(new File(desPath)).exists()) { (new File(desPath)).mkdirs(); } if (!(new File(desPath)).exists()) { (new File(desPath)).mkdir(); }

注意mkdir()和mkdirs()的区别!

最新回复(0)