电子科技大学22计算机科学与技术面向对象程序设计期末考核试题库带答案参考4.docx

上传人:夺命阿水 文档编号:121180 上传时间:2025-07-10 格式:DOCX 页数:9 大小:16.35KB
下载 相关 举报
电子科技大学22计算机科学与技术面向对象程序设计期末考核试题库带答案参考4.docx_第1页
第1页 / 共9页
电子科技大学22计算机科学与技术面向对象程序设计期末考核试题库带答案参考4.docx_第2页
第2页 / 共9页
电子科技大学22计算机科学与技术面向对象程序设计期末考核试题库带答案参考4.docx_第3页
第3页 / 共9页
电子科技大学22计算机科学与技术面向对象程序设计期末考核试题库带答案参考4.docx_第4页
第4页 / 共9页
电子科技大学22计算机科学与技术面向对象程序设计期末考核试题库带答案参考4.docx_第5页
第5页 / 共9页
点击查看更多>>
资源描述

1、书山有路勤为径,学海无涯苦作舟! 住在富人区的她电子科技大学22春“计算机科学与技术”面向对象程序设计期末考核试题库带答案参考一.综合考核(共30题)1.下列常见的系统定义的异常中,()是输入、输出异常。A.UnknownHostExceptionB.IOExceptionC.FileNotFoundExceptionD.ClassNotFoundException参考答案:B2.在一个applet标记中,()标记属性项可以省去不写。A.widthB.heightC.codebaseD.code参考答案:C3.在Java中,用()关键字定义常量。A.fixedB.finalC.#defineD

2、const参考答案:B4.下面是类A的构造函数声明,其中正确的是()。A.void a(int x).B.void A(int x).C.a(int x).D.A(int x).参考答案:D5.下列Java常见事件类中()是鼠标事件类。A.WindowEventB.MouseEventC.KeyEventD.InputEvent参考答案:B6.设有下面两个类的定义:class Personlong id; String name; class Student extends Personint score; int getScore()return score; 则类 Person 和类 S

3、tudent 的关系是()。A.继承关系B.无关系C.包含关系D.关联关系参考答案:A7.Which modifier should be applied to a method for the lock of object this to be obtained prior to execution any of the method body? ()A.synchronizedB.staticC.finalD.abstract参考答案:A8.容器Panel和Applet默认使用的布局管理器是()。A.GridLayoutB.FlowLayoutC.CardLayoutD.BorderLay

4、out参考答案:B9.下列命令中,()命令是Java的编译命令。A.javadocB.javacC.javaD.appletviewer参考答案:B10.对于catch子句的排列,下列()是正确的。A.父类在先,子类在后B.有继承关系的异常不能在同一个try结构程序段内C.排列顺序可任意D.子类在先,父类在后参考答案:D11.下列()修饰符可以使在一个类中定义的成员变量只能被同一包中的类访问。A.无修饰符B.publicC.protectedD.private参考答案:A12.若要抛出异常,应该使用下列()子句。A.tryB.throwC.finallyD.catch参考答案:B13.()类是

5、所有异常类的父类。A.ThrowableB.ExceptionC.ErrorD.AWTError参考答案:B14.Java源文件中最多只能有一个(),其他类的个数不限。A.publicB.interfaceC.finalD.abstract参考答案:A15.以下()约束符可用于定义成员常量。A.staticB.finalC.abstractD.No modifier can be used参考答案:B16.Frame的默认布局管理器是()。A.GridLayoutB.FlowLayoutC.CardLayoutD.BorderLayout参考答案:D17.Java语言没有无符号整数类型、指针类

6、型、结构类型、枚举类型、共用体类型。()A.正确B.错误参考答案:A18.下列代码的执行结果是()。 public class Apublic static void main(Stringargs)System.out.println(5/2);A.2.5B.3C.2D.2.0参考答案:C19.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

7、b=new B(); System.out.println(b.getNumber(0); what is the result?A.compilation succeeds and 3 is printedB.compilation succeeds and 2 is printedC.compilation succeeds and 1 is printedD.An error at this program cause compilation to fail参考答案:C20.在Java语言中,系统常量null,false,true既可以大写,也可以小写。()A.正确B.错误参考答案:B2

8、1.Give incompleted method:/oneif(unsafe()/do something else if(safe()/do the other The method unsafe() will throw an IOException, which completes the method of declaration when added at line one。()A.public void methodName() throws IOExceptionB.public void methodName() throw IOExceptionC.public void

9、methodName()D.public IOException methodName()参考答案:A22.class Apublic String toString()return 4+;class B extends Apublic String toString()return super.toString()+3;public class Testpublic static void main(Stringargs)B b=new B();System.out.println(b.toString(); what is the result。()A.the program throw

10、an exceptionB.nullC.7D.43参考答案:D23.有类定义:abstract class Apublic abstract void f(); 下面关于该类的描述中正确的是()。A.该类的方法不能被重载B.该类可以用new A(); 实例化一个对象C.该类不能被继承D.以上说法都不对参考答案:D24.Java语言中,字符变量以char类型表示,它在内存中占()位bit。A.8B.32C.2D.16参考答案:D25.创建字符串s:String s=new String(abcd); 以下()将改变s。A.以上语句都不会B.s.substring(3);C.s.concat(y)

11、D.s.append(x);参考答案:A26.Java中main()函数的值是()。A.voidB.intC.charD.String参考答案:A27.class Superpublic float getNum()return 3.0f; public class Sub extends Super /overload which method, placed at overload, will cause a compiler error?A.public void getNum(double d)B.public void getNum()C.public float getNum()

12、return 4.0f;D.public double getNum(float d)return 4.0d;参考答案:B28.在j2sdk1.4.2版中,解压得到的目录中,()是存放编译器、解释器和其他许多工具的目录。A.libB.jreC.demoD.bin参考答案:D29.main方法是Java Application程序执行的入口点,下列main方法原型()是不正确的。A.public static void main(stringargs)B.public static void main(Stringargs)C.public static void main(Stringa)D.public static void main(String args)参考答案:A30.抽象方法必须在抽象类中,所以抽象类中的方法都必须是抽象方法。()A.正确B.错误参考答案:B

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 习题/试题

宁ICP备18001539号-1