内容发布更新时间 : 2025/7/19 3:56:06星期一 下面是文章的全部内容请认真阅读。
试题编号:
重庆邮电大学2010~2011学年第2学期 《面向对象程序设计-Java》试卷(B卷)(期末)(闭卷)
专业 班级 姓名 学号
题 号 得 分 评卷人 一 二 三 四 五 六 七 八 总 分 注意:所有试题的答案必须写在答卷纸上。
一、单项选择题(本大题共20小题,每小题1分,共20分)
1. 编译Java应用程序源文件将产生相应的字节码文件,这些字节码文件的扩展名为( )
A.java B.class C.html D.exe
2. 在Java Applet程序用户自定义的Applet子类中,一般需要覆盖父类的( )方法来完成一些画图操作。
A.start() B.stop() C.init() D.paint() 3. 不允许作为类及类成员的访问控制符的是( ) A.public B.private C.static D.protected
4. 欲构造ArrayList类的一个实例,此类继承了List接口,下列哪个方法是正确的 ? ( )
A.ArrayList myList=new Object(); B.List myList=new ArrayList(); C.ArrayList myList=new List(); D.List myList=new List(); 5. 指出正确的表达式 ( )
A.byte=128; B.Boolean=null; C.long l=0xfffL; D.double=0.9239d; 6. 指出下列程序运行的结果 ( ) public class Example{
String str=new String(\ char[]ch={'a','b','c'};
public static void main(String args[]){ Example ex=new Example(); ex.change(ex.str,ex.ch);
System.out.print(ex.str+\
《面向对象程序设计_Java》(B卷)第 1页 /(共 13页)
Sytem.out.print(ex.ch); }
public void change(String str,char ch[]){ str=\ ch[0]='g'; } }
A.good and abc B.good and gbc C.test ok and abc D.test ok and gbc 7. 运行下列程序, 会产生什么结果 ( )
public class X extends Thread implements Runable{ public void run(){
System.out.println(\ }
public static void main(String args[]) {
Thread t=new Thread(new X()); t.start(); } }
A.第一行会产生编译错误 B.第六行会产生编译错误 C.第六行会产生运行错误 D.程序会运行和启动
8. 容器被重新设置大小后,哪种布局管理器的容器中的组件大小不随容器大小的变化而改变? ( )
A.CardLayout B. FlowLayout C.BorderLayout D.Gr