lizm166

Java 创建文本内容

import java.io.FileWriter;
import java.io.IOException;
public class TestFile {
    public static void main(String[] args) {
        StringBuffer sb=new StringBuffer();
        sb.append("12345\n");
        sb.append("abcde\n");
        sb.append("123.abc");
        try {
            FileWriter fw=new FileWriter("c:/test.txt");
            fw.write(sb.toString());
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}    

 

分类:

技术点:

相关文章:

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