《Java程序设计》综合复习题(24页)

内容发布更新时间 : 2025/6/19 18:28:14星期一 下面是文章的全部内容请认真阅读。

A、java.io.Exception B、java.lang.Throw C、java.lang.Exception D、java.lang.Error 126、异常包含下列哪些内容?( A )

A、程序执行过程中遇到的事先没有预料到的情况 B、程序中的语法错误 C、程序的编译错误

D、以上都是

127、对于已经被定义过可能抛出异常的语句,在编程时( A )。 A、必须使用try/catch语句处理异常,或用throws将其抛出 B、如果程序错误,必须使用 try/catch语句处理异常 C、可以置之不理

D、只能使用try/catch语句处理

128、若抛出用户自定义异常,应使用的子句是( B )。 A、catch

B、throw

C、try

D、finally

129、下列选项中属于除零异常的是( B )

A、NullpointerException B、ArithmeticException C、ArrayOutofBoundsException

D、SecurityException

130、下列程序段执行后,其输出结果是( B )。 public class Test{

public static void main(String[] args) throws Exception{ try{

throw new Exception(); }catch(Exception e){

System.out.println(\in main()\ }

System.out.println(\ } }

A、Caught in main() B、Caught in main() nothing C、nothing

D、没有任何输出

131、下列程序段执行后,其输出结果是( B )。 public class Test{

public static void throwit(){ System.out.print(\); throw new RuntimeException(); }

public static void main(String [] aa){ try{

System.out.print(\); throwit(); }catch(Exception re){

13

System.out.print(\); }finally{

System.out.print(\); }

System.out.print(\); } }

A、hello throwit caught

二、判断题(判断正误,对的打√,错误的打×)

1、Java语言中可用下标和指针两种方式表示数组元素。( × ) 2、Java语言既是面向对象的又是面向网络的高级语言。( √ ) 3、Java语言中取消了联合概念,保留了结构概念。( × ) 4、Java程序不区分大小写字母。( × )

5、Java语言的源程序不是编译型的,而是编译解释型的。( √ )

6、Java Applicat

>>展开全文<<
12@gma联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4 ceshi