您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 漳州分类信息网,免费分类信息发布

Java 实例 - 创建临时文件

2025/2/13 17:47:30发布13次查看
以下实例演示了使用 file 类的 createtempfile() 方法来创建临时文件:
/* author by w3cschool.cc main.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("临时文件已创建:"); out.close(); }}
以上代码运行输出结果为:
临时文件已创建:
以上就是java 实例 - 创建临时文件的内容。
漳州分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录