格林模拟试题二参考答案

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

 

answer 15)

1) ipadx
2) fill
3) insets


answer 16)

2) the buttons will run from left to right along the top of the frame

the call to the setlayout(new flowlayout()) resets the layout manager for the entire frame and so the buttons end up at the top rather than the bottom.


answer 17)

2) it is a field of the gridbagconstraints class for controlling component placement
3) a valid settting for the anchor field is gridbagconstraints.north


answer 18)

4) clean compile but no output at runtime


this is a bit of a sneaky one as i have swapped around the names of the methods you need to define and call when running a thread. if the for loop were defined in a method called public void run() and the call in the main method had been to b.start() the list of values from 0 to 9 would have been output.


answer 19)

2) false

you can re-use the same instance of the gridbagconstraints when added successive components.


answer 20)

4) an interface that ensures that implementing classes cannot contain duplicates


answer 21)

2) the add method returns false if you attempt to add an element with a duplicate value

i find it a surprise that you do not get an exception.


answer 22)

1) the program exits via a call to exit(0);
2) the priority of another thread is increased
3) a call to the stop method of the thread class


note that this question asks what can cause a thread to stop executing, not what will cause a thread to stop executing. java threads are somewhat platform dependent and you should be carefull when making assumptions about thread priorities. on some platforms you may find that a thread with higher priorities gets to "hog" the processor. you can read up on this in more detail at

视频学习

我考网版权与免责声明

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

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

最近更新

社区交流

考试问答