首页 > 建筑工程
题目内容 (请给出正确答案)
[多选题]

关于try…catch语句说法正确的有()。

A.try代码块中编写可能发生异常的Java语句

B.catch代码块中编写针对异常进行处理的代码

C.catch代码块需要一个参数指明它所能够接收的异常类型

D.try…catch不是必须一起出现的,也可以只有try

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“关于try…catch语句说法正确的有()。”相关的问题
第1题
下述有关Java语言异常处理的命题中哪一个是错误的()

A.try语句后面必须要跟有catch语句

B.try语句后面可以跟有多个catch语句

C.catch语句可以不带参数

D.不论在try代码中是否发生了异常事件,finally语句块中的语句都会执行

点击查看答案
第2题
To build your audience, you'd better catch the opportunities to be acquainted with people
and try to catch their attention on you.

A.Y

B.N

C.NG

点击查看答案
第3题
抛出异常后,控制执行try块后适当的catch块处理程序(如果存在)。()
点击查看答案
第4题
阅读以下程序,给出运行结果。classMultiCatch{publicstaticvoidmain(Stringargs[]){try{inta=ar

阅读以下程序,给出运行结果。

classMultiCatch{

publicstaticvoidmain(Stringargs[]){

try{

inta=args.length;

intb=44/a;

intc[]={2,6};

c[44]=100;

System.out.println("b="+b);

}catch(ArithmeticExceptione){

System.out.println("除0异常");

}catch(ArrayIndexOutOfBoundsExceptione){

System.out.println("数组超越边界异常");

}finally{

System.out.println("程序执行结束");

}

}

}

运行结果是:

点击查看答案
第5题
能够将异常向栈顶传递的是下列哪一个关键字?()

A.catch

B.throws

C.throw

D.try

点击查看答案
第6题
If you try to chase two rabbits at the same time, you will not catch ()one.

A.each

B.any

C.neither

D.either

点击查看答案
第7题
请写出程序运行的结果。publicclassAAA{publicstaticvoidmain(String[]args){intm=0,n=0,t=1234

请写出程序运行的结果。

publicclassAAA{

publicstaticvoidmain(String[]args){

intm=0,n=0,t=1234;

try{m=Integer.parseInt("6666");

n=Integer.parseInt("89ab");

t=8888;

}

catch(NumberFormatExceptione){

System.out.println("发生异常");

}

System.out.println("m="+m+",n="+n+",t="+t);

}

}

运行结果:

点击查看答案
第8题
对以下代码片段作用的最准确描述是()try{wx.removeStorageSync('key')}catch(e){//Dosomethingwhencatcherror}

A.从本地缓存中异步移除指定key

B.从本地缓存中同步移除指定key

C.异步清空本地数据缓存

D.同步清空本地数据缓存

点击查看答案
第9题
请选择正确的选项,将文本文件"t1.txt"中的文字信息读入内存中: BufferedReader rd; String str1; void setup(){ size(400,400); background(0); ① //将与文件"t1.txt"关联 textFont(font1);} void draw(){ try{ ② } //如果文件打开正确,则读取当前行信息赋值给str1 catch(IOException e){e.printStackTrace();str1=null; } if(str1==null) noLoop(); }

A.①rd=BufferedReader("t1.txt"); ②str1=rd.readLine();

B.①rd=createReader("t1.txt"); ②str1=rd.readLine();

C.①rd=BufferedReader("t1.txt"); ②str1=rd.read();

D.①rd=createReader("t1.txt"); ②str1=rd.read();

点击查看答案
第10题
对以下代码片段作用的最准确描述是()try{wx.clearStorageSync()}catch(e){//Dosomethingwhencatcherror}

A.从本地缓存中异步移除指定key

B.从本地缓存中同步移除指定key

C.异步清空本地数据缓存

D.同步清空本地数据缓存

点击查看答案
第11题
下列关于异常的说法正确的是()。

A.异常声明可以声明多个异常,中间用“;”分开

B.抛出异常是指程序运行中出现异常情况时发生中断的现象

C.抛出异常是异常处理的起点

D.使用关键字catch声明可能发生的异常

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改