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

运行以下程序时,控制台上输出什么? public class Test { public static void main(String[] args) { try { p(); System.out.println("After the method call"); } catch (RuntimeException ex) { System.out.println("RuntimeException"); } catch (Exception ex) { System.out.println("Exception"); } } static void p() throws Exception { try { String s = "5.6"; Integer.parseInt(s); // Cause a NumberFormatException int i = 0; int y = 2 / i; System.out.println("Welcome to Java"); } c

A.输出两次 RuntimeException

B.输出两次Exception.

C.输出 RuntimeException 和 After the method call.

D.输出Exception 和 RuntimeException.

答案
FirstMessage
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“运行以下程序时,控制台上输出什么? public class…”相关的问题

第1题

运行以下程序时,控制台上显示什么? public class Test { public static void main (String[] args) { try { System.out.println("Welcome to Java"); return; } finally { System.out.println("The finally clause is executed"); } } }

A.Welcome to Java

B.Welcome to Java 和 The finally clause is executed

C.The finally clause is executed

D.什么都不输出

点击查看答案

第2题

运行以下程序时,控制台上显示什么? public class Test { public static void main (String[] args) { try { System.out.println("Welcome to Java"); return; } finally { System.out.println("The finally clause is executed"); } } }

A.Welcome to Java

B.Welcome to Java 和 The finally clause is executed

C.The finally clause is executed

D.什么都不输出

点击查看答案

第3题

运行以下程序时,控制台上显示什么? public class Test { public static void main (String[] args) { try { System.out.println("Welcome to Java"); return; } finally { System.out.println("The finally clause is executed"); } } }

A.Welcome to Java

B.Welcome to Java 和 The finally clause is executed

C.The finally clause is executed

D.什么都不输出

点击查看答案

第4题

运行以下程序时,控制台上显示什么? public class Test { public static void main(String[] args) { try { System.out.println("Welcome to Java"); int i = 0; double y = 2.0 / i; System.out.println("Welcome to HTML"); } finally { System.out.println("The finally clause is executed"); } } }
A.Welcome to Java.###SXB###B.Welcome to Java和 The finally clause is executed.###SXB###C.Welcome to Java, Welcome to HTML和The finally clause is executed.###SXB###D.什么都不输出.
点击查看答案

第5题

运行以下程序时,控制台上显示什么? public class Test { public static void main(String[] args) { try { System.out.println("Welcome to Java"); int i = 0; int y = 2/i; System.out.println("Welcome to Java"); } catch (RuntimeException ex) { System.out.println("Welcome to Java"); } finally { System.out.println("End of the block"); } } }

A.输出3次Welcome to Java 然后是 End of the block.

B.输出2次 Welcome to Java two times然后是End of the block.

C.输出3次Welcome to Java.

D.输出2次Welcome to Java.

点击查看答案

第6题

运行以下程序时,控制台上显示什么? public class Test { public static void main(String[] args) { try { System.out.println("Welcome to Java"); int i = 0; int y = 2 / i; System.out.println("Welcome to HTML"); } finally { System.out.println("The finally clause is executed"); } } }
A.Welcome to Java, 然后是错误信息.###SXB###B.Welcome to Java 和 The finally clause is executed, 然后是错误信息.###SXB###C.Welcome to Java, Welcome to HTML和The finally clause is executed, 然后是错误信息.###SXB###D.什么都不输出.
点击查看答案

第7题

运行以下程序时,控制台上显示什么? public class Test { public static void main(String[] args) { try { System.out.println("Welcome to Java"); int i = 0; int y = 2/i; System.out.println("Welcome to Java"); } catch (RuntimeException ex) { System.out.println("Welcome to Java"); } finally { System.out.println("End of the block"); } System.out.println("End of the block"); } }

A.输出3次 Welcome to Java 然后是 End of the block.

B.输出2次Welcome to Java然后是End of the block.

C.输出2次Welcome to Java 然后是2次 End of the block.

D.没有输出.

点击查看答案

第8题

运行以下程序时,控制台上显示什么? public class Test { public static void main(String[] args) { try { System.out.println("Welcome to Java"); int i = 0; int y = 2/i; System.out.println("Welcome to Java"); } finally { System.out.println("End of the block"); } System.out.println("End of the block"); } }

A.输出3次Welcome to Java 然后是 End of the block.

B.输出2次Welcome to Java 然后是 End of the block.

C.输出2次Welcome to Java 然后是2次 End of the block.

D.输出Welcome to Java 和 End of the block, 然后由于未处理的异常而终止。

点击查看答案

第9题

若运行以下程序时从键盘上输入9,则输出的结果是 int n; scanf("%d",&n); if(n++<10) printf("%dn",n); else printf("%dn",n--);

A.9

B.8

C.10

D.11

点击查看答案

第10题

地址动态重定位的时机是____

A.编写程序时

B.运行程序时

C.编译程序时

D.加载程序时

点击查看答案
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
温馨提示
每个试题只能免费做一次,如需多次做题,请购买搜题卡
立即购买
稍后再说
警告:系统检测到您的账号存在安全风险

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

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