1 / 12
文档名称:

java面向对象程序设计java试题一.doc

格式:doc   大小:87KB   页数:12页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

java面向对象程序设计java试题一.doc

上传人:cai.li.bin 2018/9/23 文件大小:87 KB

下载得到文件列表

java面向对象程序设计java试题一.doc

相关文档

文档介绍

文档介绍:Java试题(一)
一、选择
,此类继承了List接口,下列哪个方法是正确的?
A ArrayList myList=new Object()
B List myList=new ArrayList()
C ArrayList myList=new List()
D List myList=new List()
()方法使用哪种类型的参数?
A Graphics
B Graphics2D
C String
D Color

A byte=128
B Boolean=null
C long l=0xfffL
D double=

public class Example{
String str=new String("good");
char[]ch={'a','b','c'};
public static void main(String args[]){
Example ex=new Example();
(,);
(+" and ");
();
}
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
, 会产生什么结果
public class X extends Thread implements Runable{
public void run(){
("this is run()");
}
public static void main(String args[])
{
Thread t=new Thread(new X());
();
}
}
A 第一行会产生编译错误
B 第六行会产生编译错误
C 第六行会产生运行错误
D 程序会运行和启动
6. 要从文件" "文件中读出第10个字节到变量C中,下列哪个方法适合?
A FileInputStream in=new FileInputStream(""); (9); int c=()
B FileInputStream in=new FileInputStream(""); (10); int c=()
C FileInputStream in=new FileInputStream(""); int c=()
D essFile in=new essFile(""); (9); int c=()
7. 容器被重新设置大小后,哪种布局管理器的容器中的组件大小不随容器大小的变化而改变?
A CardLayout
B FlowLayout
C BorderLayout
D GridLayout
8. 给出下面代码:
public class Person{
static int arr[] = new int[10];
public static void main(String a[])
{
(arr[1]);
}
}
那个语句是正确的?
A 编译时将产生错误
B 编译时正确,运行时将产生错误
C 输出零
D 输出空
9. 哪个关键字可以对对象加互斥锁?
A transient
B synchronized
C serialize
D static
10. 下列哪些语句关于内存回收的说明是正确的?
A 程序员必须创建一个线程来释放内存
B 内存回收程序负责释放无用内存
C 内存回收程序允许程序员直接释放内存
D 内存回收程序可以在指定的时间释放内存对象
11. 下列代码哪几行会出错:
1) public void modify() {
2) int I, j, k;
3) I = 100;
4) while ( I > 0 ) {
5) j = I