如何使用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 老板祝福语简短20字
12 圣诞贺卡祝福语简短高级
13 作文老师寄语简短祝福语
14 带猫的祝福语简短
15 岳母生日贺卡祝福语简短
16 霸气新年祝福语大全简短
17 小升初送给儿子祝福语简短
18 简短宝贝祝福语大全集