[Java] 纯文本查看 复制代码 package com.test;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Scanner;
public class Demo_Print {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
BufferedWriter bw =new BufferedWriter
(new OutputStreamWriter(new FileOutputStream("aaa.txt"),"utf-8"));
bw.write(s);
bw.close();
}
}
这是代码实现,这个老师讲过,基础班的21天第12节课 |