标签:
1 public class Practice { 2 public static void main(String[] args) { 3 try{ 4 PrintStream out = System.out; 5 PrintStream ps = new PrintStream("./a.txt"); 6 System.setOut(ps); 7 System.out.println("年龄为18,性别为女"); 8 System.setOut(out); 9 System.out.println("信息已经录入,请查看"); 10 }catch(FileNotFoundException e){ 11 e.printStackTrace(); 12 } 13 } 14 }
标签:
原文地址:http://www.cnblogs.com/mtc-dyc/p/4622619.html