码迷,mamicode.com
首页 > 系统相关 > 详细

How to save console output to a file in Eclipse

时间:2016-11-03 02:14:42      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:.com   second   sys   clip   lips   target   get   nts   line   

https://coderanch.com/t/278299/java/Writing-output-console-file-system

 

File file = new File("test.txt");
FileOutputStream fis = new FileOutputStream(file);
PrintStream out = new PrintStream(fis);
System.setOut(out);
System.out.println("First Line");
System.out.println("Second Line");
System.out.println("Third Line");
System.out.println("Fourth Line");

How to save console output to a file in Eclipse

标签:.com   second   sys   clip   lips   target   get   nts   line   

原文地址:http://www.cnblogs.com/cdsj/p/6024947.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!