package cn.mldn.demo;
import java.io.*;
public class Test{
	public static void main(String[] args) throws IOException {
		//创建文件写入内容,如果再次执行不追加。
		//FileOutputStream fos=new FileOutputStream("info1.txt");
		//文件末尾追加内容
		FileOutputStream fos=new FileOutputStream("info1.txt",true);
		for(int x=0;x<3;x++){
			fos.write(("hello"+x).getBytes());
			fos.write("\r\n".getBytes());
		}
	}
}

  

相关文章:

  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
猜你喜欢
  • 2021-08-11
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案