admin 管理员组

文章数量: 1184232


2024年3月13日发(作者:java怎么定义数组并赋值)

《t0501》试卷

一、单选题(每题1分,共计30分)

1、下面关于javac命令作用的描述中,正确的是 2

A、可以执行java程序

B、可以将编写好的Java文件编译成.class文件

C、可以把文件压缩

D、可以把数据打包

2、下列选项中,可以正确配置classpath的命令是( 1 )

A、set classpath =C:Program FilesJavajdk1.7.0_15bin

B、set classpath : C:Program FilesJavajdk1.7.0_15bin

C、classpath set =C:Program FilesJavajdk1.7.0_15bin

D、classpath set : C:Program FilesJavajdk1.7.0_15bin

3、请阅读下面的程序3

public class Example03 {

public static void main(String[] args) {

int x = 8;

if (x > 5) {

n("a");

} else {

n("b");

}

}

}

程序的运行结果是?()

A、true

B、false

C、a

D、b

4、int a[ ]={45,4,67,23,65,87,34,52,56};数组中a[5]的值为( 4 )

A、23

B、45

C、65

D、87

5、Java中所有的类都是通过直接或间接地继承( 1 )类得到的

A、

B、

C、任意类

D、以上答案都不对

6、下面哪个修饰符不可以修饰接口中的成员变量?(4)

A、public

B、static

C、final

D、private

7、Thread类位于下列哪个包中?2

A、

B、

C、

D、

8、阅读下面一段代码2

Integer in1 = new Integer(10);

Integer in2 = new Integer(10);

Integer in3 = 10;

Integer in4 = 10;

(in1 == in2);

(in1 == in3);

(in3 == in4);

下列选项中,程序的运行结果是(4)

A、true true true

B、false false true

C、false false false

D、false true false

9、下列关于注释的使用,错误的是?( 3 )

A、int c = 10; //定义变量c

B、/* int c = 5; int x =6; */

C、/** 这是类的入口方法 */

D、/* /*int c = 10;*/ int x=5; */

10、阅读下列的代码

public class Test {

public static void main(String[] args) {

_________________________

_________________________

}

}

class Outer {

static class Inner {

public void method () {

n("method");

}

}

}

下列选项中,填写在空白处可以使程序正常运行的是()


本文标签: 下列 程序 文件 定义