唯智信息技术(上海)有限公司

更新时间:2023-07-19 11:34:01 阅读量: 实用文档 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

选择题 1:以下的C程序代码片段运行后C和d的值分别是多少

Int a =1,b =2;

Int c,d;

c =(a&b)&&a;

d =(a&&b)&a;

A.0,0

B.0,1

C.1,0

D.1,1

2: 1. What is the result when you compile and run the following code? 2.

3. public class Test

4.

5. {

6.

7. public void method()

8.

9. {

10.

11. for(int i = 0; i < 3; i++)

12.

13. {

14.

15. System.out.print(i);

16.

17. }

18.

19. System.out.print(i);

20.

21. }

22.

23. }

24.

25. Choices:

A.0122

B.0123

pilation error

D.None of these

3:Math.round(11.5)等於多少?

A.11

B.12

C.11.5 D.none

4:

1. Give the following java class:

2. public class Example{ 3. static int x[]=new int[15];

4. public static void main(String args[]){

5. System.out.println(x[5]);

6. }

7. }

8. Which statement is corrected?

A.When compile, some error will occur.

B.When run, some error will occur.

C.Output is zero.

D.Output is null.

5:

1. Give the following java source fragement:

2. //point x

3. public class Interesting{

4. //do something

5. }

6. Which statement is correctly Java syntax at point x?

A.public class MyClass{//do other thing…}

B.static int PI=3.14

C.class MyClass{//do something…}

D.none

6:Which fragments are not correct in Java source file?

A.package testpackage; public class Test{//do something...}

B.import java.io.*; package testpackage; public class Test{// do something...}

C.import java.io.*; class Person{// do something...} public class Test{// do something...}

D.import java.io.*; import java.awt.*; public class Test{// do something...}

7: Which of the following statements are true?

A.The automatic garbage collection of the JVM prevents programs from ever running out of memory

B.A program can suggest that garbage collection be performed and force it

C.Garbage collection is platform independent

D.An object becomes eligible for garbage collection when all references denoting it are set to null.

8:Math.round(-11.5)等於多少?

A.-11

B.-12

C.-11.5

D.none

9:设有变量说明语句int a=1,b=0;

则执行以下程序段的输出结果为( )。

switch (a)

{

case 1:

switch (b)

{

case 0:printf("**0**");break;

case 1:printf("**1**");break;

}

case 2:printf("**2**");break;

}

printf("\n");

A.**0**

B.**0****2**

C.**0****1****2**

D.有语法错误

10:下面关于变量及其范围的陈述哪些是错的。

A.实例变量是类的成员变量。

B.实例变量用关键字static声明。

C.在方法中定义的局部变量在该方法被执行时创建

D.局部变量在使用前必须被初始化。

11: 1. What results from attempting to compile and run the following code? 2.

3. public class Ternary

4.

5. {

6.

7. public static void main(String args[])

8.

9. {

10.

11. int a = 5;

12.

13. System.out.println("Value is - " + ((a < 5) ? 9.9 : 9));

14.

15. }

16.

17. }

18.

19. Choices:

A.prints: Value is - 9

pilation error

C. prints: Value is - 5

D.None of these

12:假定a和b为int型变量,则执行下述语句组后,b的值为

a=1;

b=10;

do

{

b-=a;

a++;

} while (b--<0);

A.9

B.-2

C.-1

D.8

13:Which code fragments would correctly identify the number of arguments passed via command line to a Java application, exclude the name of the class that is being invoke.

A.int count = args.length;

B.int count = args.length-1;

C.int count=0; while(args[count]!=null) count++;

D.int count=0;while (!(args[count].equals(“”))) count++;

14:使用 JDBC 可以做到的是

A.把二进制代码传送到任何关系数据库中

B.把 Java 源代码传送到任何关系数据库中

C.把表单信息传送到任何关系数据库中

D.很容易地把 SQL 语句传送到任何关系数据库中

简答题

15:X博士是一个研究儿童智力开发方法的科学家,他为幼儿教育领域做出了许多贡献。最近,X博士正在研究一种适合儿童的游戏,用以辅助发展儿童的观察力、注意力和思维能力。经过连日的构思,X博士终于设计出了一种游戏:彩球游戏。

彩球游戏是一种单人参与的游戏,游戏首先给出一串由许多不同颜色的小球组成的小球序列,以及一个整数参数M(M≥2)。一段连续的具有相同颜色的小球序列称为连续同色序列。小孩,即游戏参与者,每次可以向任意一段连续同色序列插入一个同色小球,使该序列的长度加一。当一段连续同色序列在插入一个同色小球后其长度达到M时,该序列就会爆炸消失,然后原序列两边的其余小球会重新连成一串,如果两段相同颜色的连续同色序列在此时连接在一起,它们就会合并形成一段新的连续同色序列。如果新形成的连续同色序列长度达到M,这段序列也会爆炸消失,然后重复上述过程,直到没有新的长度达到M的连续同色序列出现为止。游戏的目标很简单,就是插入尽量少的小球,使得所有小球都爆炸消失掉。

通过长时间的游戏和不断提高游戏水平,这个游戏可以很好地开发儿童的观察力、注意力和思维能力。但是X博士仍然面临着一个困难的问题,他还需要设计出一个游戏演示AI程序,可以以最优的方式(即插入的小球数量最小)进行游戏,用于游戏教学,或者在游戏中对小孩给出提示。X博士并不擅长此类程序,因而他无法完成这个任务,你可以帮助他吗?

16:说明Jsp中errorPage的作用,应用范围。

17:saveOrUpate()和merge()的异同?

18:设计一函数,求整数区间[a,b]和[c,d]的交集。

19:Error与Exception有什么区别?

20:常见的struts标签有那些?

21:说出ArrayList,Vector, LinkedList的存储性能和特性。

22:说出在JSP页面里是怎么分页的?

23:应用服务器与WEB SERVER的区别?

24:垃圾回收的优点和原理。 并考虑2种回收机制。

25:如何给weblogic指定大小的内存?

本文来源:https://www.bwwdw.com/article/wug1.html

Top