JAVA题库:格林模拟试题二(下)(4)

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

 

question 40)

which of the following statements are correct?

1) if multiple listeners are added to a component only events for the last listener added will be processed
2) if multiple listeners are added to a component the events will be processed for all but with no guarantee in the order
3) adding multiple listeners to a comnponent will cause a compile time error
4) you may remove as well add listeners to a component.


question 41)

given the following code

class base{}
public class mycast extends base{
static boolean b1=false;
static int i = -1;
static double d = 10.1;
public static void main(string argv[]){
mycast m = new mycast();
base b = new base();
//here
}
}


which of the following, if inserted at the comment //here will allow the code to compile and run without error

1) b=m;
2) m=b;
3) d =i;
4) b1 =i;


question 42)

which of the following statements about threading are true

1) you can only obtain a mutually exclusive lock on methods in a class that extends thread or implements runnable
2) you can obtain a mutually exclusive lock on any object
3) a thread can obtain a mutually exclusive lock on an object by calling a synchronized method on that object.
4) thread scheduling algorithms are platform dependent


question 43)

your chief software designer has shown you a sketch of the new computer parts system she is about to create. at the top of the hierarchy is a class called computer and under this are two child classes. one is called linuxpc and one is called windowspc.

the main difference between the two is that one runs the linux operating system and the other runs the windows system (of course another difference is that one needs constant re-booting and the other runs reliably). under the windowspc are two sub classes one called server and one called workstation. how might you appraise your designers work?


1) give the goahead for further design using the current scheme
2) ask for a re-design of the hierarchy with changing the operating system to a field rather than class type
3) ask for the option of windowspc to be removed as it will soon be obsolete
4) change the hierarchy to remove the need for the superfluous computer class.

视频学习

我考网版权与免责声明

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

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

最近更新

社区交流

考试问答