首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

帮小弟我看看如何改

2013-04-20 
帮我看看怎么改?while(flage!-1){flagereader.read(bt)System.out.println(new String(bt)+flage)}文

帮我看看怎么改?
while(flage!=-1)
   {
  flage=reader.read(bt);
  System.out.println(new String(bt)+flage);
   }
文件内容:
Hello word!
hello word!
为什么输出内容是这样?
Hello word!11

hello wor11
d!hello wor2
d!hello wor-1

[解决办法]
System.out.println(new String(bt,0,flage)+flage);
[解决办法]
while(flage==11)
   {
      flage=reader.read(bt);
      for(int i=0;i<flage;i++)
      System.out.print(bt[i]);
   }

热点排行