PrintStream 标准的输出流。默认输出到控制台
System.out.println("hello world!")//联合起来写
PrintStream ps =System.out; out为System类的变量,
定义为public static final PrintStream out = null;
ps.println("hello zhangsan"); //分开写
标准输出流可以不指向控制台:
PrintStream printStream =new PrintStream(new FileOutputStream("log"));
System.setOut(printStream) 修改输出方向到log文件