Java示例创建的临时文件 Java示例文件只读 Java示例临时文件路径 Java示例创建的临时文件 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示例文件只读 Java示例临时文件路径