importjava.io.BufferedWriter;importjava.io.File;importjava.io.FileWriter;importjava.io.IOException;publicclassHomework01{publicstaticvoidmain(String[] args)throwsIOException{String filePath ="c:\\mydir";File file =newFile(filePath);if(!file.exists()){if(file.mkdirs())System.out.println(filePath +" has been created successfully..");elseSystem.out.println(filePath +" was fail to be created..");}else{System.out.println(filePath +" has already existed..");}String destfile = filePath +"\\hello.txt";File file1 =newFile(destfile);if(!file1.exists()){if(file1.createNewFile()){BufferedWriter bufferedWriter =newBufferedWriter(newFileWriter(file1));
bufferedWriter.write("hello, world~~ 韩顺平教育");
bufferedWriter.close();System.out.println(destfile +" has been created successfully..");}else{System.out.println(destfile +" has already existed..");}}else{System.out.println(destfile +" has already existed..");}}}
IDEA 使用小技巧(三) 配置目录Ctrl 鼠标方法缩小字体 配置目录
IDEA 在使用的过程中会在 C 盘的用户目录下写入相关配置,目录如下:
"C:\Users\个人用户名\AppData\Local\JetBrains" "C:\Users\个人用户名\AppDa…