- 80
- 0
- 约9.42千字
- 约 40页
- 2017-07-12 发布于河南
- 举报
JAVA课程异常1
7 关于java语言中常用的异常类的说法,错误的一个是 A在不合法的数学运算发生时,会出现ArithmeticException类异常 B 如果字符串转换成数字,需要准备处理NumberFormatException异常 C 如果使用非法的索引值来访问数组,ArrayIndexOutOfBoundsException异常会被抛出 D如果指针变量为空,NullPointException异常就会被抛出 D Java中没有指针 使用null对象引用方法或变量将产生该异常 14 运行下列程序,将产生什么异常? A ArrayIndexOutOfBoundsException B NumberFormatException C ArithmeticException D ArithmeticException和ArrayIndexOutOfBoundsException public class test14 { public static void main(String[] args) { int x=0; int y=2/x; int z[]={1,2,4,6}; int p=z[4]; } } C 15 下列描述正确的是 A 在catch代码段中可以使用return语句返回到异常抛出点 B 异常机制可以用于流程控制 C catch(Exception e)可以
原创力文档

文档评论(0)