请问这道题

glmemail 2003-07-16 05:02:16
51. Click the exhibit button.
1. import java.io.lOException;
2. public class ExceptionTest {
3. public static void main (String[] args) {
4. try {
5. methodA();
6. } catch (lOException e) {
7. System.out.println("Caught lOException");
8. } catch (Exception e) {
9. System.out.println("Caught Exception");
10. }
11.}
12. public static void methodA () {
13. throw new lOException ();
14. }
15. }
What is the result?
A. The code will not compile.
B. The output is caught exception.
C. The output is caught lOException.
D. The program executes normally without printing a message.
为什么不能抛IOException异常?

...全文
59 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
robin_xin_xin 2003-07-18
  • 打赏
  • 举报
回复
同意楼上的意见
cuihao 2003-07-17
  • 打赏
  • 举报
回复
编译不通过

public static void methodA () throws IOException
{
throw new IOException ();
}
qxjavajava 2003-07-16
  • 打赏
  • 举报
回复
你编译一下看看结果再说不要盲目相信那些给的答案 有些是很明显的错误呢

50,530

社区成员

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

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