2024年3月26日发(作者:)

文档

1) Public class MyExamplc{

Public static void main(string args[ ]){

n(args[1]) ;

如果以下列命令行运行,上述JAVA代码将输出()

java MyExample IMTIOnline

a) MyExample

b) IMTI

c) Online

d) Exception raised;

“ndexoutofBoundsException:2”

2) 下面JAVA代码编译运行后,下列选项中,()会出现在输出

结果中。(选择三项)

public class test3{

public static void main(string args[ ]) {

for (int i=0;i<3; i ++){

for(int j=3;j >=0;j--){

if(i= =j)

continue;

n(“i=”+i+“j”=+j);

a) i =0 j=3

b) i =0 j=0

c) i =2 j=2

1 / 22

文档

d) i =0 j=2

e) i =1 j=2

3) 在java中,Applet类的()方法返回一个URL对象,它表

示包含此applet 的HTML文件的目录。(选择一项)

a) getAbsolutepath()

b) getDocumentBase()

c) getCodeBase()

d) getURL()

e) getpath()

4) 运行下列JAVA代码后,下面选项中,包含在输出结果中的是

()

(选择两项)

public class Example{

public static void main(string args[ ]) {

int i=0

do{

n(“Doing it for i is “+i);

}while(--i>0)

n(“Finished”);

}

a) Doing it for i is 3

b) Doing it for i is 1

c) Doing it for i is 2

d) Doing it for i is 0

e) Finished

2 / 22