zoukankan      html  css  js  c++  java
  • system.out输出到文件上

    1. public class SayInFile {   
    2.     public SayInFile(){   
    3.         try {   
    4.             //文件生成路径   
    5.             PrintStream ps=new PrintStream("D:\role.txt");   
    6.             System.setOut(ps);   
    7.         } catch (FileNotFoundException e) {   
    8.             e.printStackTrace();   
    9.         }   
    10.     }   
    11.     public static void main(String[] args) {   
    12.         System.out.println("我在文件里了!");   
    13.     }   
  • 相关阅读:
    模板
    kuangbin带你飞
    BZOJ开荒记
    模板
    洛谷
    模板
    [蓝桥杯][2013年第四届真题]危险系数
    数位DP入门题
    备战2019蓝桥杯
    常用的数学符号
  • 原文地址:https://www.cnblogs.com/yangqimo/p/8269410.html
Copyright © 2011-2022 走看看