静态I/O输入出错,高手请帮忙!

hoyome 2004-10-29 08:55:32
刚抄一段CODE,

byte chArray[]=new byte[128];
System.out.print("Please enter the word: ");
System.in.read(chArray);
System.out.println("Your input words is: ");
System.out.println(chArray);

运行时没有结果:
Please enter the word: good
Your input words is:
[B@18e3e60

请问哪边出错了,谢谢!
...全文
84 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
GJA106 2004-11-04
  • 打赏
  • 举报
回复
System.in--in指InputStream,实现接收键盘输入的信息,同时你输入的信息会在DOS控制台显示。
System.out--out指PrintStream,在DOS控制台显示指定信息,由对象的toString来控制。如果是数组对象,System.out只能显示数组对象地址。

50,535

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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