第一章 北邮java.docxVIP

  • 40
  • 0
  • 约8.81千字
  • 约 20页
  • 2017-07-08 发布于湖北
  • 举报
作业一一、单项选择题(共10道小题,共100.0分) 设有如下程序public class Try2 {?????? public static void main(String[] args) {????????????? Try2 obj = new Try2();????????????? obj.test();?????? }?????? ?????? void oneMethod() {????????????? int a [] = {1, 2, 3};????????????? System.out.println(a[3]);?????? }?????? ?????? public void test() {????????????? try {???????????????????? oneMethod( );???????????????????? System.out.println(condition 1);????????????? }????????????? catch (ArrayIndexOutOfBoundsException e) {???????????????????? System.out.println(condition 2);????????????? }????????????? catch (Exception e) {???????????????????? System.out.println(condition 3);????????????? }????????????? finally {???????????????????? System.out.println(finally);????????????? }?????? }}则程序的输出结果的是(? )condition 1finally condition 2finally condition 3finally 3aondition 1finally 知识点:阶段作业二学生答案:[B;]??得分:[10]试题分值:10.0提示:?设有如下程序public class Try2 {?????? public static void main(String[] args) {????????????? Try2 obj = new Try2();????????????? obj.test();?????? }?????? ?????? void oneMethod() { }?????? ?????? public void test() {????????????? try {???????????????????? oneMethod( );???????????????????? System.out.println(condition 1);????????????? }????????????? catch (ArrayIndexOutOfBoundsException e) {???????????????????? System.out.println(condition 2);????????????? }????????????? catch (Exception e) {???????????????????? System.out.println(condition 3);????????????? }????????????? finally {???????????????????? System.out.println(finally);????????????? }?????? }}则程序的输出结果的是(? )condition 1 condition 1finally condition 1condition 2condition 3 condition 1condition 2condition 3finally 知识点:阶段作业二学生答案:[B;]??得分:[10]试题分值:10.0提示:?给定下面程序段class Equals {??? public static void main(String args[]) {??????? int x = 100;??????? double y = 100.1;??????? boolean b = ( x = y );??????? System.out.println(b);??? }}??? 下面选项正确的是(? )输出:true?? 输出:flase 编译失败抛出一个运行时异常知识点:阶段作业二学生答案:[C;]??得分:[10]试题分值:10.0提示:?(错误)下面不属于“异常”现象的是(? )程序创建对象时没有足够

文档评论(0)

1亿VIP精品文档

相关文档