java将数据写入文件中

  • Post author:
  • Post category:java


import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class Test2 {

	public static void main(String[] args) throws IOException {
		
		File file =new File("D:\\2.txt");
		Writer out =new FileWriter(file);
		String data="888";
		out.write(data);
		out.close();
	}

}



版权声明:本文为u012045045原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。