当前位置: 首页 > 计算机二级 > 计算机二级模拟试题 > 2020年9月全国计算机二级JAVA冲刺练习(9月24日)

2020年9月全国计算机二级JAVA冲刺练习(9月24日)

更新时间:2020-09-24 16:44:59 来源:环球网校 浏览41 收藏16
摘要 小伙伴们有没有等着急呢?刷题、刷题、刷题,似乎成了考前安放自己紧张心情的一种方式,也能在刷题中再给自己增加一番自信,那就赶快来看看环球网校小编整理的2020年9月全国计算机二级JAVA冲刺练习(9月24日),其他更多科目的冲刺练习敬请关注环球网校计算机二级频道。

2020年9月全国计算机二级JAVA冲刺练习(9月24日)

1.下列选项成员变量声明正确的是()。

A.publicprotectedfinalinti;

B.abstractclassFl{…}

C.privatedoubleheight;

D.doubleweight()

2.下面程序段的输出结果是()。

classTest{

publics,taticvoidmain(Stringargs[]){

MyThreadt=newMyThread();

t.displayOutput("thasbeencreateD");

t.start();

}

}

ClassMyThreadextendsThread{

publicvoiddisplayOutput(Strings){

System.out.println(s);

}

publicvoidrun(){

displayOutput("tisrunning.");

}

}

A.thasbeencreated.

B.thasbeencreated.tisrunning.

C.tisrunning.

D.编译出错

3.执行下列程序时,会产生什么异常()。

publicclassTest{

publicstaticvoidmain(Stringargs[]){

intd=101;

intb=220:

longa=321;

System.OUt.println((a-b)/(a-b-d));

}

}

A.ArraylndexOutOfBoundsException

B.NumberFormatException

C.ArithmeticException

D.EOFExeeption

4.下面程序段的输出结果为()。

publicclassTest

{

publicstaticvoidmain(Stringargs[])

{

booleana,b,C;

a=(3<5):

b=(a==true);

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

c=(b==false);

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

}

}

A.a=trueb=falseB.fl=trueb=false

b=truec=trueb=truec=false

C.a=trueb=trueD.a=falseb=false

b=truec=falseb=truec=false

5.下面程序段的输出结果是()。

publicclassTest{

publicstaticvoidmain(Stringargs[]){

inta,b;

for(a=1,b=1;a<=100;a++){

if(b>=10)break;

if(b%2==1){

b+=2:

continue;

}

}

System.OUt.println(a);

}

}

A.5B.6

C.7D.101

6.栈中允许进行插入和删除的一端称为()。

A.栈顶B.栈底

C.栈端D.栈尾

7.下面程序段的输出结果是()。

publicclassTest{

publicstaticvoidmain(Stringargs[]){

inti=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

8.Frame默认的布局管理器是()。

A.FlowLayout

B.BorderLayout

C.GridLayout

D.UpLayout

9.在Java语言中,ObjectOutputStream是指()。

A.字节流

B.字符流

C.对象输出流

D.数据流

10.请阅读下列程序代码,然后将程序的执行结果补充完整。横线处应填写的内容是()。

程序代码:

publicclassthrowsExeeption{

staticvoidProc(intsel)

throwsArithmeticException,ArrayIndexOutOf

BoundsException{

System.out.println("InSituation"+sel);

if(sel==0){

System.OUt.println("noExceptioncaught");

return;

}

elseif(sel==l){

intiArray[]=newint[4];

iArray[1]=3;

}

}

publicstaticvoidmain(Stringargs[]){

try{

Proe(O);

Proc(1);

}

catch(ArrayIndexOutOfBoundsExceptione){

System.out.println("Catch"+e);

}

finally{

System.out.println("inProcfinally"):

}

}

}

执行结果:

InSituation0

noExceptioncaught

inProcfinally

A.InSituationl

B.InSituation

C.withCatch

D.intiArrayl

以上就是“2020年9月全国计算机二级JAVA冲刺练习(9月24日)”相关内容,小伙伴们快来了解一下吧,大家可“ 免费预约短信提醒”计算机二级报名、考试、查分时间等届时环球网校会及时为大家推送2020年全国计算机二级考试信息提醒,确保大家顺利考试!环球网校友情提示:在备战计算机二级考试中,环球网校特地为您准备了计算机二级复习资料,如有需要请点击文章下方“免费下载>>>计算机二级考试资料”下载学习。

编辑推荐

分享到: 编辑:环球网校

资料下载 精选课程 老师直播 真题练习

计算机二级资格查询

计算机二级历年真题下载 更多

计算机二级每日一练 打卡日历

0天
累计打卡
0人
打卡人数
去打卡

预计用时3分钟

计算机二级各地入口
环球网校移动课堂APP 直播、听课。职达未来!

安卓版

下载

iPhone版

下载

返回顶部