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

来源:java认证发布时间:2012-11-12 12:47:30java认证视频

 一. 真实考试说明 
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 

上一页12下一页

视频学习

我考网版权与免责声明

① 凡本网注明稿件来源为"原创"的所有文字、图片和音视频稿件,版权均属本网所有。任何媒体、网站或个人转载、链接转贴或以其他方式复制发表时必须注明"稿件来源:我考网",违者本网将依法追究责任;

② 本网部分稿件来源于网络,任何单位或个人认为我考网发布的内容可能涉嫌侵犯其合法权益,应该及时向我考网书面反馈,并提供身份证明、权属证明及详细侵权情况证明,我考网在收到上述法律文件后,将会尽快移除被控侵权内容。

最近更新

社区交流

考试问答