Java 创建临时文件1 Java 设置文件修改日期lastModified Java 创建临时文件2 Java 创建临时文件1 import java.io.*; public class Main { public static void main(String[] args) throws Exception { File temp = File.createTempFile ("pattern", ".suffix"); temp.deleteOnExit(); BufferedWriter out = new BufferedWriter (new FileWriter(temp)); out.write("aString"); System.out.println("temporary file created:"); out.close(); } } Java 设置文件修改日期lastModified Java 创建临时文件2