Java经典模拟题(onlyfortrainning)(1)

文章作者 100test 发表时间 2007:03:14 17:02:29
来源 100Test.Com百考试题网


一. 真实考试说明
1.考试形式:网络计算机
2.考题形式:多选,单选,简答
3.题量:60
4.考试时间:120分钟




二.模拟题

1.which statement about the garbage collection mechanism are true?
a.garbage collection require additional program code in cases where multiple threads are running.
b.the programmer can indicate that a reference through a local variable is no longer of interest.
c.the programmer has a mechanism that explicit and immediately frees the memory used by java objects.
d.the garbage collection mechanism can free the memory used by java object at expectable time.
e.the garbage collection system never reclaims memory from objects while are still accessible to running user threads.

2. give the following method:
1)public void method( ){
2) string a,b.
3) a=new string(“hello world”).
4) b=new string(“game over”).
5) system.out.println(a b ”ok”).
6) a=null.
7) a=b.
system.out.println(a).
9) }
in the absence of compiler optimization, which is the earliest point the object a referred is definitely hand to be garbage collection.
a. before line 3 b.before line 5 c. before line 6 d.before line 7 e. before line 9

3. which statement about listener is true?
a.most component allow multiple listeners to be added.
b.if multiple listener be add to a single component, the event only affected one listener.
c.component don’t allow multiple listeners to be add.
d.the listener mechanism allows you to call an addxxxlistener method as many times as is needed, specifying as many different listeners as your design require.

4.give the following code:
public class example{
public static void main(string args[] ){
int l=0.
do{
system.out.println(“doing it for l is:” l).
}while(--l>.0)
system.out.println(“finish”).
}
}
which well be output:
a. doing it for l is 3b. doing it for l is 1c. doing it for l is 2
d. doing it for l is 0e. doing it for l is –1f. finish

5. give the code fragment:
1)switch(x){
2) case 1: system.out.println(“test 1”).break.
3) case 2:
4) case 3: system.out.println(“test 2”).break.
5) default: system.out.println(“end”).
6) }
which value of x would cause “test 2” to the output:
a. 1b. 2c. 3d. default


相关文章


JAVA题库:格林模拟试题一(上)(2)
JAVA题库:格林模拟试题一(上)(1)
编写多线程Java应用程序常见问题
Java经典模拟题(onlyfortrainning)(2)
Java经典模拟题(onlyfortrainning)(1)
理解JavaHelp结构的好处
java入门Java中的日期处理
Java认证模考试题(十一)
Java认证模考试题(九)
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛