《Java程序设计》课程 试卷3
一、单选题(每题2分,共40分)
1.欲构造ArrayList类的一个实例,此类继承了List接口,下列哪个方法是正确的 ?
A、 ArrayList myList=new Object();B、 List myList=new ArrayList();
C、 ArrayList myList=new List(); D、 List myList=new List();
2.paint()方法使用哪种类型的参数?A、 Graphics B、 Graphics2D C、 String D、 Color
3.指出正确的表达式 ( )
A、 byte=128; B、 Boolean=null; C、 long l=0xfffL; D、 double=0.9239d;
4.指出下列程序运行的结果
public class Example{
String str=new String("good");
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+" and ");
Sytem.out.print(ex.ch);
}
public void change(String str,char ch[]){
str="test ok";
ch[0]='g';
}
}
A、 good and abc B、 good and gbc C、test ok and abc D、 test ok and gbc
5.运行下列程序, 会产生什么结果
public class X extends Thread implements Runable{
public void run(){
System.out.println("this is run()");
} public static void main(String args[]) { Thread t=new Thread(new X()); t.start();
}
}
A、 第一行会产生编译错误 B、 第六行会产生编译错误
C、 第六行会产生运行错误 D、 程序会运行和启动
6.要从文件" file.dat"文件中读出第10个字节到变量C中,下列哪个方法适合?
A、 FileInputStream in=new FileInputStream("file.dat"); in.skip(9); int c=in.read();
B、 FileInputStream in=new FileInputStream("file.dat"); in.skip(10); int c=in.read();
C、 FileInputStream in=new FileInputStream("file.dat"); int c=in.read();
java模拟试题java模拟试题隐藏>> 09 年全国计算机二级考试 java 模拟试题三(答案附试卷尾页) 一、选择题(每题 2 分,共计 70 分) 1.数据的存储结构是指 A...
Java 模拟试题(三) 模拟试题(一、判断题(24'') 1.如果 p 是父类 Parent 的对象,而 c 是子类 Child 的对象,则语句 c = p 是正 确的。 2.当一个...
java程序设计模拟试题三 暂无评价0人阅读0次下载举报文档《Java 程序设计》模拟试题三一、选择题(每小题 ...
(btn); add(result); btn.addActionListener(this); Label result; TextField in1,in2; Button btn; int a=0,b=0,max; Java 模拟试卷 3 参考答案 参考...
java模拟试题3 隐藏>> 一、 填空(本题共 15 空,每空 2 分,共 30 分) 1.如果一个 java 源程序文件中定义有 4 个类,使用 sun 公司的 JDK 编译器 ...
《Java程序设计》模拟试题3_工学_高等教育_教育专区。西安电子科技大学远程教育《Java程序设计》模拟试题系列之三学习中心 姓名学号 西安电子科技大学网络教育学院 ...
java模拟题-3_其它_高等教育_教育专区。三、判断题 1 、protected 访问权限要小于包访问权限。 (我坚信他是错的) 2 、要使某个类成为抽象类并不需要所有的...
Java 模拟试题(三) 模拟试题(一、判断题(24'') 1.如果 p 是父类 Parent 的对象,而 c 是子类 Child 的对象,则语句 c = p 是正 确的。F 2.当一...
北京语言大学网络教育学院 《JAVA 语言程序设计》模拟试卷三注意: 1.试卷保密,考生不得将试卷带出考场或撕页,否则成绩作废。请监考老师负责监督。 2.请各位考生...
关键词:试题复习资料模拟试卷 同系列文档 朝鲜历届领导人资料 朝鲜现状 为什么...()方法,它前面有三个修饰符是 static , void 3 java 语言数据类型可分为...
热门文档