首页 > 其他 > 详细

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

时间:2016-01-24 15:34:13      阅读:116      评论:0      收藏:0      [点我收藏+]

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();
}
}

}

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

原文:http://www.cnblogs.com/shaoshanhuo/p/5155116.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!