mjchzhl 发表于 2016-11-26 21:58
搞不懂啊,能给讲详细点吗,谢谢了
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();
}
}
zsq8210366 发表于 2016-11-28 21:04
[mw_shl_code=java,true]package com.test;
import java.io.BufferedWriter;

mjchzhl 发表于 2016-11-28 22:16
感谢,我还没有开始上课
| 欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |