重定向到文件:

System.setOut(new PrintStream(new File("data\\train.1.scale")));

 

重定向回console:

//把输出重定向会console上
System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));

 

相关文章: