Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 java.io.IOException: 句柄无效???
aideliwu





发贴: 18
积分: 0
于 2004-09-01 14:15 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我还是被

Exception in thread "main" Exit code: 1
There were errors

这个错误迷惑着啦,你能帮帮我吗,有人说我的 main 方法中

代码有误,可是我编译可以通过呀,但运行出错啦呀.

请帮我留意一下我的代码,耐心看一看,先谢谢你啦:

import java.io.*;
public class NumberInput{
public static void main(String args[]) throws IOException
{
String s;
InputStreamReader ir=new InputStreamReader(System.in);
BufferedReader in=new BufferedReader(ir);
s=in.readLine();
System.out.println("Input value is: "+s);
int i=Integer.parseInt(s);
i*=2;
System.out.println ("Input value changed after doubled:"+i);
}
}

呵呵呵呵~辛苦啦~~帮帮我哦~~给我些解决的提示哈,

等待你的回音,^-^~^-^~




Please try to use the Edit function and check "Disable Smileys".
I have corrected the typo for you.

啊啊啊~`我的代码~在我提交时~不小心~错啦一点小错误啦:
上代码中的 i=intInteger.parseInt(s);
在我原代码中是int i=Integer.parseInt(s);啦.

main中的错误应该是在其他地方啦~


why edited on 2004-09-01 20:47

作者 Re:java.io.IOException: 句柄无效??? [Re:aideliwu]
xiaopa





发贴: 6
积分: 0
于 2004-09-01 14:34 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
windowsXP + JDK1.4.2 正常执行完毕


作者 Re:java.io.IOException: 句柄无效??? [Re:aideliwu]
七品县令





发贴: 1
积分: 0
于 2004-09-01 17:28 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
执行正常亚


作者 Re:java.io.IOException: 句柄无效??? [Re:aideliwu]
aideliwu





发贴: 18
积分: 0
于 2004-09-01 21:32 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我思考le很久,也查看啦代码很久,可还是百思不得其解,
在Freejava中运行的结果还是:
java.io.IOException: 句柄无效。
  at java.io.FileInputStream.readBytes(Native Method)
  at java.io.FileInputStream.read(FileInputStream.java:191)
  at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)
  at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
  at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:406)
  at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:446)
  at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:180)
  at java.io.InputStreamReader.read(InputStreamReader.java:167)
  at java.io.BufferedReader.fill(BufferedReader.java:136)
  at java.io.BufferedReader.readLine(BufferedReader.java:299)
  at java.io.BufferedReader.readLine(BufferedReader.java:362)
  at NumberInput.main(NumberInput.java:9)
Exception in thread "main" Exit code: 1
There were errors

对于我来说,这样de提示问题真de可大le,为什么会句柄无效呢??我只是用啦:
InputStreamReader(System.in);
我访问de资源是什么呢???为什么会无效呢????
at java.io.FileInputStream.read(FileInputStream.java:191)
其中de参数怎么是FileInputStream.java:191呢?? ":191"又是什么呀???
哎~望你能不吝赐教,不厌我烦de给一个迷糊中de菜鸟提示,
再次感谢你,你的帮助会使我在java路上少走好多弯路,剩好多时间de.



作者 Re:java.io.IOException: 句柄无效??? [Re:aideliwu]
aideliwu





发贴: 18
积分: 0
于 2004-09-02 22:51 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
哪位高手~~真de真de~耐心看一下我de问题呀~

城心希望能得到你de帮助

期待你de回音



费尽心思思考,不得结果不罢休,饭可以不吃,觉可以不睡,问题不能不解决
作者 Re:java.io.IOException: 句柄无效??? [Re:aideliwu]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2004-09-03 03:20 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
试试重装 J2SDK 吧


作者 Re:java.io.IOException: 句柄无效??? [Re:why]
aideliwu





发贴: 18
积分: 0
于 2004-09-03 09:02 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
~恩恩~~~~~~对~~~~有其他人说可以运行啦~

~我试试~重装哈~~~~

~谢谢啦~~~~~~問題兒童 ~^-^~~



费尽心思思考,不得结果不罢休,饭可以不吃,觉可以不睡,问题不能不解决
作者 Re:java.io.IOException: 句柄无效??? [Re:aideliwu]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2004-09-03 09:21 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
>> 有人说我的 main 方法中代码有误
不是有误,也是有误

不是句法有误
但是 main 方法 throws IOException
查一查,throws IOException 有甚么作用;
想一想,这合理吗?


似乎阁下已经设置好 JDK,于此应该不再有问题吧。

敝人不常在 J2SE 版出现,有事勿找敝人。Smile
(这裡有不少热心助人的会员,多向大家学习好了。
当然,先搜尋旧帖子。)
)



作者 Re:java.io.IOException: 句柄无效??? [Re:aideliwu]
aideliwu





发贴: 18
积分: 0
于 2004-09-03 09:21 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
~呵呵呵呵~~谢谢你啦~~~why~~~~

~我de问题已经在你de帮助下解决啦~

~希望在以后de时间li你能~更多de注意我de问题~多给我帮助哈~~~

~~~^_^~^_^~~~~



费尽心思思考,不得结果不罢休,饭可以不吃,觉可以不睡,问题不能不解决

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923