2020年计算机二级JAVA考试每日一练(5月27日)
2020年计算机二级JAVA考试每日一练(5月27日)
1.栈中允许进行插入和删除的一端称为( )。
A.栈顶
B.栈底
C.栈端
D.栈尾
答案:A
2.下面程序段的输出结果是( )。
public class Test{
public static void main(String args[]){
int i=1:
switch(i){
case0:
System.OUt.println("0");
break;
casel:
System.out.println("1");
case2:
System.OUt.println("2");
break;
default:
System.out.println("default");
}
}
}
A.01
B.12
C.10
D.21
答案:B
3.Frame默认的布局管理器是( )。
A.FlowLayout
B.BorderLayout
C.GridLayout
D.UpLayout
答案:B
4.在Java语言中,ObjectOutputStream是指( )。
A.字节流
B.字符流
C.对象输出流
D.数据流
答案:C
5.请阅读下列程序代码,然后将程序的执行结果补充完整。横线处应填写的内容是( )。
程序代码:
public class throwsExeeption{
static void Proc(intsel)
throws Arithmetic Exception,Array Index Out Of
Bounds Exception{
System.out.println("InSituation"+sel);
if(sel= =0){
System.OUt.println("noException caught");
return;
}
else if(sel= =l){
int iArray[]=newint[4];
iArray[1]=3;
}
}
public static void main(String args[]){
try{
Proe(O);
Proc(1);
}
catch(Array Index Out Of Bounds Exception e){
System.out.println("Catch"+e);
}
finally{
System.out.println("inProcfinally"):
}
}
}
执行结果:
In Situation 0
no Exception caught
in Proc finally
A.In Situation l
B.In Situation
C.with Catch
D.int iArray l
答案:A
更多2020年计算机二级JAVA考试每日一练试题,请继续关注环球网校计算机二级频道。需要及时了解考试动态的小伙伴可“ 免费预约短信提醒”届时环球网校会及时为大家推送2020年计算机二级考试相关信息提醒。环球网校友情提示:对于想要参加计算机二级考试的小伙伴们,环球网校特地为您准备了计算机二级考试资料,如有需要请点击文章下方“免费下载>>>计算机二级考试资料”下载学习。