6、exists()) { myFolderPath.mkdir();}}catch (Exception e) {System.out.println("新建目录操作出错");e.printStackTrace();} 2.创建文件//import java.io.*;File myFilePath = new File(%%1);try {if (!myFilePath.exists()) {myFilePath.createNewFile();}FileWriter resultFile = new FileWriter(myFilePath);PrintW
7、riter myFile = new PrintWriter(resultFile);myFile.println(%%2);myFile.flush();resultFile.close();}java修改文件名import java.io.*; public class test1{ public static void main(String[] args) { File file=new File("D:/gai.jpg"); //指定文件名及路径Stringname="123";