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