当前位置: > 下面这段程序看不懂 谁能大概解释下的...
题目
下面这段程序看不懂 谁能大概解释下的
import java.io.*;
class J_Exception extends Exception {
} public class J_Test {
public static void main(String[] args)
{ try { int i = System.in.read(); if(i == '0')
throw new J_Exception(); //手动抛出异常
System.out.print("1");
}catch(IOException ex) {
System.out.print("2");
}catch(J_Exception ex) {
System.out.print("3");
}finally
{ System.out.println("4");
}
}
}
为什么当输入0时得到34

提问时间:2021-01-24

答案
你这不是写的很清楚了么.class J_Exception extends Exception {}public class J_Test {public static void main(String[] args) {try {int ...
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.