import java.io.FileNotFoundException;
import java.io.PrintStream;
public class main {
public static void main(String[] args) throws FileNotFoundException {
System.out.println("今天1月4号");
PrintStream ps = new PrintStream("0.txt");
System.setOut(ps); //把打印流改为本地文件
System.out.println("明天星期四");
System.out.print("后天");
System.out.print("星期五");
}
}
本地生成文件