字节流 system.out ---->printStream

public class StreamDemo6 {
public static void main(String[] args) {
try {
//不自动刷新,后面可以添加一个参数 true,来自动刷新
PrintStream ps = new PrintStream(new FileOutputStream(
"D:\\javalessons\\coreJava\\javaSE-core\\print.txt"));
//System.out 目标是标准输出设备 System.in标准输入设备
ps.println("helloworld");
ps.println("bye-bye");//ps.print("hello");不输出换行
ps.close();
} catch (Exception e) {
e.printStackTrace();
}
}

}

posted @ 2016-01-24 14:32  烧山火的光  阅读(243)  评论(0)    收藏  举报