关于回车的小问题,回车的unicode是13还是1013???

xiguawjy 2005-05-18 07:17:13
以下的程序输入abcdef 后,得到的结果中第三行出现的97 98 99 100 101 101 13 10
我不知道为什么会有10
回车‘\r'是用2个字节来保存的,它的unicode是'\u000d'那就是13,可是怎么会有10呢??
class IO1{
public static void main(String args[]) throws java.io.IOException{
byte buffer[]=new byte[40];
System.out.println("input 40个数");
int count=System.in.read(buffer);
System.out.println("保存在缓冲区的元素个数"+count);
System.out.println("buffer中的元素是");
for(int i=0;i<count;i++){
System.out.print(" "+buffer[i]);}
System.out.println();
System.out.print("输出buffer元素");
System.out.write(buffer,0,buffer.length);

}
}
...全文
375 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
mnbvc874 2005-05-19
  • 打赏
  • 举报
回复
了解
xiguawjy 2005-05-19
  • 打赏
  • 举报
回复
非常谢谢!
OnlyFor_love 2005-05-19
  • 打赏
  • 举报
回复
13回车
10换行
ariel_521 2005-05-19
  • 打赏
  • 举报
回复
回车实质上是先把光标移到该行的首位置上,然后再把光标挪到下一行。
zhudonhua 2005-05-19
  • 打赏
  • 举报
回复
支持
evil_nowt 2005-05-18
  • 打赏
  • 举报
回复
windows系统就这样,回车被它默认为是\n\r(回车+换行)
unix下就只有回车了
sunshine5246 2005-05-18
  • 打赏
  • 举报
回复
13回车
10换行
oyljerry 2005-05-18
  • 打赏
  • 举报
回复
unicode两个字节
lxleaves 2005-05-18
  • 打赏
  • 举报
回复
0x000D
0x000A
大熊猫侯佩 2005-05-18
  • 打赏
  • 举报
回复
10 应该是换行吧

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧