JAVA进阶7.9——Print流(2)
来源:互联网 发布:都都宝app软件 编辑:程序博客网 时间:2024/05/17 06:24
import java.io.PrintStream;import java.util.Scanner;//import java.io.PrintStream;////public class Test{//public static void main(String[] args)throws Exception{//PrintStream printLiu=new PrintStream("D:/3.txt");//输出流//System.setOut(printLiu);//设置输出位置,把输出到屏幕上改为输出到3.txt中。//System.out.println("大家好");//}//}public class Test{public static void main(String[] args){PrintStream printLiuZhengQue=null;PrintStream printLiuCuoWu=null;Scanner s=null;try{printLiuZhengQue=new PrintStream("D:/a.txt");printLiuCuoWu=new PrintStream("D:/b.txt");s=new Scanner(System.in);int number;System.setOut(printLiuZhengQue);System.setErr(printLiuCuoWu);while(true){number=s.nextInt();System.out.println(number);}}catch(Exception e){System.err.println("输入有误");}}}
0 0
- JAVA进阶7.9——Print流(2)
- JAVA进阶7.8——print流(1)
- Java 定制工具库 —— Print(import static)
- 邂逅java——print() ,println()
- Java print流简介
- Java print流
- Python学习笔记(2)——print
- Java-Print流,Object流
- JAVA进阶7.2——字符流
- JAVA进阶7.3——字节流
- JAVA进阶7.5——缓冲流
- JAVA进阶3.2——Equals方法(2)
- JAVA进阶知识点总结(2)— 包:Package
- 告别System.out.print()—J2SDK1.4新增Java日志框架 (一)
- 告别System.out.print()—J2SDK1.4新增Java日志框架(二)
- 告别System.out.print()—J2SDK1.4新增Java日志框架(三)
- 2017.7.5(转)—【学习笔记】python2的print和python3的print()
- JAVA进阶-IO流(2)
- Spring框架参考手册_5.0.0_中英文对照版_Part II_3.5
- C fibonaccio 递归与循环
- swift中switch的使用及注意事项
- 彤姐的程序篇(三)
- 2016国庆集训day3-minimum.cpp
- JAVA进阶7.9——Print流(2)
- 最好的git命令行教程
- java截取两个字符之间的字符串
- linux之read命令
- HDU - 1172 猜数字
- AsyncTask学习笔记
- Leetcode 173: Binary Search Tree Iterator
- win_flex_bison常用命令-QGIS编译中使用
- 完全分布式Hadoop集群的安装搭建和配置(4节点)