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

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


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.



相关文章


还在考1.2的同志请看
JAVA题库:格林模拟试题二(下)(7)
Java之关键字(keyword)和保留字(reservedword)
.Net和Java应融合
JAVA题库:格林模拟试题二(下)(4)
JAVA题库:格林模拟试题二(下)(6)
消除关于.NET的四个误解
java中的assert(断言)
Java虚拟机参数详解
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛