打印流
PPG007 ... 2021-12-27 Less than 1 minute
# 打印流
PrintStream
PrintWriter
PrintWriter printWriter = new PrintWriter(new FileWriter(PATH_PREFIX + "3.txt"));
printWriter.print(PATH_PREFIX);
printWriter.close();
System.setOut(new PrintStream(PATH_PREFIX+"3.txt"));
for (int i = 0; i < 100; i++) {
System.out.println(i);
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9