Java认证经典模拟题(onlyfortrainning)

来源:互联网
责任编辑:王嘉善
字体:

一. 真实考试说明

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. <$xue63fenye$><$lovfpfenye$>

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

6. give incompleted method:

1)

2){if(unsafe()){//do something…}

3)else if(safe()){//do the other…}

4)}

the method unsafe() will throw an ioexception, which completes the method of declaration when added at line one?

a.public ioexception methodname()

b.public void methodname()

c.public void methodname() throw ioexception

d.public void methodname() throws ioexception

e.public void methodname() throws exception

7. give the code fragment:

if(x>;4){

system.out.println(“test 1”);}

else if (x>;9){

system.out.println(“test 2”);}

else {

system.out.println(“test 3”);}

which range of value x would produce of output “test 2”?

a. x<4b. x>;4c. x>;9d. none

8. give the following method:

public void example(){

try{

unsafe();

system.out.println(“test1”);

}catch(safeexception e){system.out.println(“test 2”);

}finally{system.out.println(“test 3”);} <$xue63fenye$><$lovfpfenye$>

system.out.println(“test 4”);

which will display if method unsafe () run normally?

a. test 1b. test 2c. test 3d. test 4

9. which method you define as the starting point of new thread in a class from which new the thread can be execution?

a. public void start()b. public void run()c. public void int()

d. public static void main(string args[])e. public void runnable()

10.given the following class definition:

class a{

protected int i;

a(int i){

this.i=i;

}

}

which of the following would be a valid inner class for this class?

select all valid answers:

a. class b{

}

b.class b extends a{

}

c.class b extends a{

b(){system.out.println(“i=”+i);}

}

d.class b{

class a{}

}

e.class a{}

资讯转帖于 Xue163.com_JAVA认证考试题库

www.book1234.com true http://www.book1234.com/kao/58/589157.html report 42987 Java认证经典模拟题(onlyfortrainning),一.真实考试说明1.考试形式:网络计算机2.考题形式:多选,单选,简答3.题量:604.考试时间:120分钟二.模拟题1.whichstatementaboutthegarbagecollectionmechanismaretrue?a.garbag...
娱乐时尚
历史文化
真视界
旅游美食
精彩图文
我爱我车
母婴健康
关于本站 | 广告服务 | 手机版 | 商务合作 | 免责申明 | 招聘信息 | 联系我们
Copyright © 2004-2018 book1234.com All Rights Reserved. 布客网 版权所有
京ICP备2021021884号-4 京公网安备11010802011102号
教育考试: 学历财经建筑 医药公考资格外语电脑作文招聘中小学留学 文档 移民 文库专栏23问答中心z资讯z资讯1资讯涨资讯涨资讯1资讯图书馆IT编程数码信息解决方案信息中心lmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmlmIT科技问答新闻中心软件教室设计大全网络相关英语学习开发编程考试中心参考范文管理文库营销中心站长之家IT信息中心商学院数码大全硬件DIY企业服务网吧在线百科硬件知识手机平板汽车游戏家电精彩摄影现代家居IT女人经验健康养生猎奇创业攻略教育学习历史时尚潮流最近更新涨知识