在jwindows操作系统里面,"\n"代表换行,而回车符由"\r\n"组成的。其实你自己用字节流就可以测试出来。
- package cn.itcast.io.p2.file.demo;
- import java.io.IOException;
- import java.io.InputStream;
- public class Test3 {
- public static void main(String[] args) throws IOException{
- InputStream is = System.in;
- int ch=0;
- while((ch=is.read())!=-1){
- System.out.println(ch);
- }
- }
- }
复制代码
输出结果:(运行起来后,直接回车)
|
|