当前位置: 首页 > 计算机二级 > 计算机二级模拟试题 > 2020年计算机二级JAVA考试每日一练(5月26日)

2020年计算机二级JAVA考试每日一练(5月26日)

更新时间:2020-05-26 15:36:03 来源:环球网校 浏览27 收藏13
摘要 备考全国计算机二级JAVA考试的小伙伴们,复习的都怎么样了呢?环球网校小编发布了2020年计算机二级JAVA考试每日一练供大家参考复习,小伙伴们快来做一做,测试一下自己吧!了解更多全国计算机二级JAVA备考资料敬请关注环球网校计算机二级频道。

2020年计算机二级JAVA考试每日一练(5月26日)

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

A.public protected final int i;

B.abstract class Fl{…}

C.private double height;

D.double weight()

答案:C

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

class Test{

public s,tatic void main(String args[]){

MyThread t=new MyThread();

t.displayOutput("t has been createD");

t.start();

}

}

Class MyThread extends Thread{

public void displayOutput(String s){

System.out.println(s);

}

public void run(){

displayOutput("t is running.");

}

}

A.t has been created.

B.t has been created. t is running.

C.t is running.

D.编译出错

答案:B

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

public class Test{

public static void main(String args[]){

int d=101;

int b=220:

long a=321;

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

}

}

A.ArraylndexOutOfBoundsException

B.NumberFormatException

C.ArithmeticException

D.EOFExeeption

答案:C

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

public class Test

{

public static void main(String args[])

{

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=true b=false

b=true c=true

B.fl=true b=false

b=true c=false

C.a=true b=true

b=true c=false

D.a=false b=false

b=true c=false

答案:C

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

public class Test{

public static void main(String args[]){

int a,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.5

B.6

C.7

D.101

答案:B

更多2020年计算机二级JAVA考试每日一练试题,请继续关注环球网校计算机二级频道。需要及时了解考试动态的小伙伴可“ 免费预约短信提醒”届时环球网校会及时为大家推送2020年计算机二级考试相关信息提醒。环球网校友情提示:对于想要参加计算机二级考试的小伙伴们,环球网校特地为您准备了计算机二级考试资料,如有需要请点击文章下方“免费下载>>>计算机二级考试资料”下载学习。

编辑推荐

分享到: 编辑:环球网校

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

计算机二级资格查询

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

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

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

预计用时3分钟

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

安卓版

下载

iPhone版

下载

返回顶部