下面这段程序看不懂 谁能大概解释下的
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
人气:385 ℃ 时间:2020-04-16 20:19:23
解答
你这不是写的很清楚了么.class J_Exception extends Exception {}public class J_Test {public static void main(String[] args) {try {int ...额 刚学的这个 不懂呵呵这回懂了不?
推荐
- 相对优势和绝对优势用英语解释并举例
- 某地大气压为75厘米汞柱,一同学在做托里拆利实验时,不慎管的上端进有空气,玻璃管在A位置时,水银柱高度
- 请问"帮助外国人了解北京"英文该怎么翻译
- 设Sn表示等比数列{an}(n∈N*)的前n项和,已知S10S5=3,则S15S5=_.
- 假设天上一颗星星离地球1光年,那么,在地球上看到的应该是1年前的星星了?
- 英语补全句子:我的妈妈总是使我感到幸福.My mother always ( )
- Would you like______chicken________supper?
- 一条铁路,从起点到终点共有8个站,现在增加3个站,两站之间往返的车票不同,需要增加几种不同的车票?
猜你喜欢