//练习一:在当前模块下的aaa文件夹中创建一个a.txt文件
public class Test06 {
public static void main(String[] args) throws IOException {
File file = new File("untitledOne\\aaa");
if (!file.exists()) {
//如果文件不存在,就创建出来
file.mkdirs();
}
File newFile = new File(file, "a.txt");
newFile.createNewFile();
}
}

浙公网安备 33010602011771号