日期:2014-05-20 浏览次数:20748 次
import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintStream; public class Test17 { public static void main(String[] args) throws FileNotFoundException { System.out.println("输出一条信息"); FileOutputStream fos = new FileOutputStream("errors.txt"); PrintStream ps = new PrintStream(fos); System.setOut(ps); System.out.println("再输出一条信息"); } }
------解决方案--------------------
自己看书找啊....