奥鹏易百

 找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

帮助中心知识拓展客服QQ 515224986
查看: 647|回复: 0

[电子科技大学] 《JAVA程序设计》3.Which modifier should be applied to a method for the ...

[复制链接]

2万

主题

27

回帖

6万

积分

管理员

积分
60146
发表于 2017-4-5 21:42:22 | 显示全部楼层 |阅读模式
扫码加微信
电科17春《JAVA程序设计》在线作业3
一、单选题:
1.下列         是Java的调试器,如果编译器返回程序代码的错误,可以用它对程序进行调试。          (满分:4)
    A. java.exe
    B. javadoc.exe
    C. jdb.exe
    D. javaprof.exe
2.在使用interface声明一个接口时,只可以使用         修饰符修饰该接口。          (满分:4)
    A. public
    B. protected
    C. private和protected
    D. private
3.Which modifier should be applied to a method for the lock of object "this" to be obtained prior to excution any of the method body?          (满分:4)
    A. synchronized
    B. abstract
    C. final
    D. static
4.下列常见的系统定义的异常中,         是数组下标越界异常。          (满分:4)
    A. ArithmeticException
    B. IOException
    C. ArrayIndexOutOfBoundsException
    D. NullPointerException
5.下列         修饰符可以使在一个类中定义的成员变量只能被同一包中的类访问。          (满分:4)
    A. private
    B. public
    C. protected
    D. 无修饰符
6.下列         关键字通常用来给对象进行加锁,该标记使得对对象的访问是排他的。          (满分:4)
    A. transient
    B. serialize
    C. synchronized
    D. static
7.Thread类的方法中,toString(    )方法的作用是          (满分:4)
    A. 只返回线程的名称
    B. 返回当前线程所属的线程组的名称
    C. 返回当前线程对象
    D. 返回线程的字符串信息
8.下列         布局管理器能够帮助用户处理两个或者两个以上的成员共享同一个显示空间,它把容器分成许多层,每层显示空间占据这个容器的大小。          (满分:4)
    A. CardLayout
    B. BorderLayout
    C. FlowLayout
    D. GridLayout
9.class A{public String toString(    ){return 4+"";}}class B extends A{public String toString(    ){return super.toString(    )+3;}}public class Test{public static void main(String[]args)   {B b=new B(    );System.out.println(b.toString(    ));}}what is the result?          (满分:4)
    A. 7
    B. null
    C. the program throw an exception
    D. 43
10.设有下面的两个类定义:class A{void show(    ){System.out.print("AA");}}class B extends A{void show(    ){System.out.print("BB");}}则顺序执行如下语句后输出的结果为         。A a=new A(    );B b=new B(    );a.show(    );b.show(    );          (满分:4)
    A. AAAA
    B. AABB
    C. BBBB
    D. BBAA
11.对于构造方法,下列叙述正确的是          (满分:4)
    A. 构造方法的方法名必须与类名相同
    B. 构造方法必须用void申明返回类型
    C. 构造方法可以被程序调用
    D. 若编程人员没在类中定义构造方法,程序将报错
12.在Java的基本数据类型中,int型数据占用         字节内存空间。          (满分:4)
    A. 1
    B. 2
    C. 4
    D. 不能确定,取决于计算机字长
13.有数组定义:int a[]={0,1,2,3,4,5,6};,则a数组的数组元素个数为          (满分:4)
    A. a.length(    )
    B. a.length(    )+1
    C. a.length
    D. a.length+1
14.class A{public int getNumber(int a){return a+1;}}class B extends A{public int getNumber(int a, char c){return a+2;} public static void main(String[] args)   {B b=new B(    );System.out.println(b.getNumber(0));} }what is the result?          (满分:4)
    A. compilation succeeds and 1 is printed
    B. compilation succeeds and 2 is printed
    C. compilation succeeds and 3 is printed
    D. An error at this program cause compilation to fail
15.在j2sdk1.4.2版中,解压得到的目录中,         是存放编译器、解释器和其他许多工具的目录。          (满分:4)
    A. jre
    B. lib
    C. demo
    D. bin
16.Java语言是在         语言基础上衍生的。          (满分:4)
    A. pascal
    B. C
    C. C++
    D. VF
17.设有下面两个类的定义:class Person{long id;String name;}class Student extends Person{int score;int getScore(    ){return score;}}则类Person和类Student的关系是          (满分:4)
    A. 包含关系
    B. 继承关系
    C. 关联关系
    D. 无关系
18.class A{public String toString(    ){return 4+"";}}class B extends A{public String toString(    ){return super.toString(    )+3;}}public class Test{public static void main(String[]args)   {B b=new B(    );System.out.println(b.toString(    ));}}what is the result?          (满分:4)
    A. 7
    B. null
    C. the program throw an exception
    D. 43
19.下列Java源文件代码片段中,         是不正确的。          (满分:4)
    A. package t;public class A{}
    B. import java.io.*;package t;public class A{}
    C. import java.io.*;class A{}public class B{}
    D. import java.io.*;import java.awt.*;public class A{}
20.Which statement is correctly declare a variable a which is suitable for refering to an array of 50 string empty object?          (满分:4)
    A. String [] a;
    B. char a[][];
    C. String a[50];
    D. String [50]a;
三、判断题:
1.(    )抽象方法必须在抽象类中,所以抽象类中的方法都必须是抽象方法。          (满分:4)
    A. 错误
    B. 正确
2.(    )Java的屏幕坐标是以像素为单位,容器的左下角被确定为坐标的起点。          (满分:4)
    A. 错误
    B. 正确
3.(    )J2SDK中主要有两个相关环境变量,即path和classpath。前者指定了JDK命令搜索路径,后者指定了Java类路径。          (满分:4)
    A. 错误
    B. 正确
4.(    )字符串分为两大类,一类是字符串常量,使用StringBuffer类的对象表示;另一类是字符串变量,使用String类的对象表示。          (满分:4)
    A. 错误
    B. 正确
5.(    )final类中的属性和方法都必须被final修饰符修饰。          (满分:4)
    A. 错误
    B. 正确

奥鹏易百网www.openhelp100.com专业提供网络教育各高校作业资源。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|www.openhelp100.com ( 冀ICP备19026749号-1 )

GMT+8, 2024-5-17 17:34

Powered by openhelp100 X3.5

Copyright © 2001-2024 5u.studio.

快速回复 返回顶部 返回列表