题目内容 (请给出正确答案)
[单选题]

int[] nums = new int[4]; try { System.out.println("字符串1"); nums[4] = 10; System.out.println("字符串2"); } catch (ArrayIndexOutOfBoundsException ex) { System.out.println("字符串3"); }finally{ System.out.println("字符串4"); } 上述代码输出结果为()

A.字符串1 字符串2 字符串3 字符串4

B.字符串1 字符串2 字符串3

C.字符串1 字符串2 字符串4

D.字符串1 字符串3 字符串4

提问人:网友cy851210 发布时间:2022-01-07
参考答案
  抱歉!暂无答案,正在努力更新中……
如搜索结果不匹配,请 联系老师 获取答案
网友答案
查看全部
  • · 有4位网友选择 D,占比44.44%
  • · 有2位网友选择 C,占比22.22%
  • · 有2位网友选择 A,占比22.22%
  • · 有1位网友选择 B,占比11.11%
匿名网友 选择了C
[79.***.***.10] 1天前
匿名网友 选择了D
[1.***.***.223] 1天前
匿名网友 选择了C
[53.***.***.167] 1天前
匿名网友 选择了A
[104.***.***.146] 1天前
匿名网友 选择了D
[227.***.***.175] 1天前
匿名网友 选择了A
[218.***.***.27] 1天前
匿名网友 选择了D
[200.***.***.14] 1天前
匿名网友 选择了D
[12.***.***.93] 1天前
匿名网友 选择了B
[169.***.***.83] 1天前
加载更多
提交我的答案
登录提交答案,可赢取奖励机会。
更多“int[] nums = new int[4]; try {…”相关的问题
第1题
class A { int x; int add() { return x+1; } } System.out.println(a); 则程序的运行结果是( )。

A、0

B、1

C、地址

D、什么也不输出

点击查看答案
第2题
有如下程序段 if(x>0){System.out.println("first");} else if(x>-4){System.out.println("second");{ else{System.out.println("third");}x的取值在什么范围内时,将打印出字符串“second”? ()

A.x>0

B.x>-4

C.x<-4

D.x<0&&x>-4

点击查看答案
第3题
对于下面的程序,x在什么范围内取值时将输出字符串”second”·()if(x>0){System.out.println("first");}elseif(x>-3){System.out.println("second");}else{System.out.println("third");}Whichrangeofxvaluewouldprintthestring"second"·

A、x>0

B、x>-3

C、x<=-3

D、x<=0&x>-3

点击查看答案
第4题
阅读下面程序片段 switch (i) { case 1: System.out.println("message1"); case 2: System.out.println("message2"); case 3: System.out.println("message3"); break; } 请选择当变量i的值为多少时,程序只输出“message 3”

A、1

B、2

C、3

D、4

点击查看答案
第5题
阅读下面代码 if(x==0){System.out.println("冠军"); else if(x>-3){System.out.println(“亚军”);} else {System.out.println(“季军”);} 若要求打印字符串“季军”,则变量x的取值范围是

A.x=0 & x<=-3

B.x>0

C.x>-3

D.x<=-3

点击查看答案
第6题
if(x<0) {system.out.println("first");} else { system.out.println("second");} {system.out.println("third");}> A、x>0

B、x>5

C、x<=5<br> D、x>=0 & x<5<br>

点击查看答案
第7题
给出下面程序段: if(x>0){System.out.println("Hello.");} else if(x>-3){ System.out.println("Nice to meet you!");} else{System.out.println("How are you?");} 若打印字符串"How are yoh?",则x的取值范围是()。

A.x>0

B.x>-3

C.x≤-3

D.x≤0&x>-3

点击查看答案
第8题
阅读下面代码 fi(x==0) { System.out.println("冠军");} else if (x>-3) { System.out.println("亚军"); } else { System.out.println("季军");} 若要求打印字符串“季军”,则变量x的取值范围是()。

A.x=0 & x<=-3

B.x>0

C.x>-3

D.x<=-3

点击查看答案
第9题
给出源字符串: String str = "i am a student"; System.out.println(str.substring(7, 14)); System.out.println(str.contains(" student")); 正确的输出结果是哪一项?

A、student false

B、studen false

C、student true

D、studen true

点击查看答案
第10题
调用一个定义时声明有可能抛出IOException的方法myMethord() 时,需要:

A、其他选项都不对

B、调用myMethord方法的语句必须使用try/catch语句处理;

C、调用myMethord方法的语句必须使用try/catch语句处理,或者,调用的方法再次声明抛出异常IOException

D、调用myMethord方法的不用特殊处理,就像调用普通方法那样;

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信