如何使用Java递归创建目录?
该 java.io.File.mkdirs()有必要的,不存在的父目录创建此抽象路径名指定的目录,共同提高。
示例
import java.io.File;
public class Main {
public static void main(String[] args) {
String directories = "D:\\a\\b\\c\\d ";
File file = new File(directories);
boolean result = file.mkdirs();
System.out.println("Status = " + result);
}
}输出结果
Status = true
热门推荐
10 祝孙辈生日祝福语简短
11 恋人跨年祝福语大全简短
12 考大学敬酒简短祝福语
13 开工投产大吉祝福语 简短
14 偶然结婚祝福语朋友简短
15 感谢学长学姐祝福语简短
16 戏精的祝福语简短
17 我要结婚祝福语简短
18 婚前女儿生日祝福语简短