首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
运行下面的程序时,会产生( )。 public class Test{ public static void main(String args[ ] ) { int x =0; int y
运行下面的程序时,会产生( )。 public class Test{ public static void main(String args[ ] ) { int x =0; int y
admin
2010-12-17
31
问题
运行下面的程序时,会产生( )。 public class Test{ public static void main(String args[ ] ) { int x =0; int y = 2/x; int z[ ] = {1,2,4,6}; int p=z[4]; } }
选项
A、ArrayIndexOutOfBoundsExcePtion异常
B、NumberFormatException异常
C、ArithmeticException异常
D、ArithmeticException异常和ArrayIndexOutOfBoundsExcePtion异常
答案
C
解析
只能出现ArithmeticException异常,由于在程序第4行出现了这个异常后,程序就跳出,不能继续执行下去,因此不会出现ArrayIndexOutOfBoundsException异常。
转载请注明原文地址:https://jikaoti.com/ti/L2H0FFFM
本试题收录于:
二级Java题库NCRE全国计算机二级分类
0
二级Java
NCRE全国计算机二级
相关试题推荐
对于循环队列,下列叙述中正确的是
软件生命周期可分为定义阶段、开发阶段和维护阶段,下面属于开发阶段任务的是
不属于对象构成成份的是
下列数据结构中,能用二分法进行查找的是
算法的空间复杂度是指
数据独立性是数据库技术的重要特点之一,所谓数据独立性是指
下列程序的运行结果是>>>s=’PYTHON’>>>“{0:3}”.format(s)
在面向对象方法中,类的实例称为
某班学生评选一等奖学金,学生的10门主干课成绩存在考生文件夹下文件“score.txt”中,每行为一个学生的信息,分别记录了学生学号、姓名以及10门课成绩,格式如下。1820161043郑珉镐686683775673616966781
通常,将软件产品从提出、实现、使用维护到停止使用退役的过程称为______。
随机试题
党的十一届三中全会以后,营养科学工作者进行了()等一些重要营养缺乏病的防治研究。
吉兰-巴雷综合征的病人约有2/3在病前6周有明确的前驱感染史,最主要的前驱感染病原体为(),其次为()。
目前PC机主流CPU的时钟频率通常为2~3________。
A.心血管疾病B.恶性肿瘤C.意外死亡D.呼吸系统疾病E.传染病行为生活方式主要引起()
下列哪几项是细辛所具有的药理作用?
2003年1月,甲市成风制衣厂与乙市顺昌贸易有限责任公司在丙市签订了一份服装买卖合同。双方当事人在合同中约定,如果日后发生争议,则由原告住所地或者合同签订地人民法院管辖。2003年5月,成风制衣厂按照合同约定向顺昌贸易有限责任公司提供了服装若干。但在成风制
建设项目对环境可能造成重大环境影响的,应当编制(),对产生的环境影响进行全面评价
在法律推理中,由一般到特殊的推理是()。
要求通过while循环不断读入字符,当读入字母N时结束循环。若变量已正确定义,以下正确的程序段是()。
A.NecessityfortheTeammatestoImproveTheirOwnSkillsB.EvaluationfromTwoDifferentPerspectivesC.SpectacularPerforma
最新回复
(
0
)