转换流的应用 – 恵玩科技

package IO.com.lxgyx_04;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;

public class SystemOutDemo2 {
    public static void main(String[] args) throws IOException {
        BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));
        bw.write("你好,我叫张大鹏");
        bw.newLine();

        bw.write("欢迎来到理想");
        bw.newLine();

        bw.write("和我一起实现梦想吧");
        bw.newLine();

        bw.close();
    }
}

 

打赏作者