public class PrintClass {
public static void main(String[] args) throws FileNotFoundException {
PrintStream ps = new PrintStream("H:\\test\\mm.txt");
ps.write(97);
ps.println(97);
ps.close();
}
}
public class PrintStrNew {
public static void main(String[] args) throws FileNotFoundException {
System.out.println("正常打印输出");
PrintStream ps = new PrintStream("H:\\test\\mm.txt");
System.setOut(ps);
System.out.println("我在文件里面了");
ps.close();
}
}