PrintStream ps = new PrintStream("/log.txt"); | |
System.setOut(ps); | |
System.out.println("本条信息输出log.txt文件。"); | |
System.setOut(System.out); | |
ps.close(); | |
System.out.println("本条信息输出终端。"); |
PrintStream ps = new PrintStream("/log.txt"); | |
System.setOut(ps); | |
System.out.println("本条信息输出log.txt文件。"); | |
System.setOut(System.out); | |
ps.close(); | |
System.out.println("本条信息输出终端。"); |