SCJP试题-SCJPMockExam1

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



Q16
What will be written to the standard output when the following program is run?

public class Q63e3 {
public static void main(String args[]) {
System.out.println(9 ^ 2);
}
}

1) 81
2) 7
3) 11
4) 0
5) false

Q17
Which statements are true concerning the default layout manager for containers in the java.awt package?

1) Objects instantiated from Panel do not have a default layout manager.
2) Objects instantiated from Panel have FlowLayout as default layout manager.
3) Objects instantiated from Applet have BorderLayout as default layout manager.
4) Objects instantiated from Dialog have BorderLayout as default layout manager.
5) Objects instantiated from Window have the same default layout manager as instances of Applet.

Q18
Which declarations will allow a class to be started as a standalone program?

1) public void main(String args[])
2) public void static main(String args[])
3) public static main(String[] argv)
4) final public static void main(String [] array)
5) public static void main(String args[])

Q19
Under which circumstances will a thread stop?

1) The method waitforId() in class MediaTracker is called.
2) The run() method that the thread is executing ends.
3) The call to the start() method of the Thread object returns.
4) The suspend() method is called on the Thread object.
5) The wait() method is called on the Thread object.

Q20
When creating a class that associates a set of keys with a set of values, which of these interfaces is most applicable?

1) Collection
2) Set
3) SortedSet
4) Map

Q21
What does the value returned by the method getID() found in class java.awt.AWTEvent uniquely identify?

1) The particular event instance.
2) The source of the event.
3) The set of events that were triggered by the same action.
4) The type of event.
5) The type of component from which the event originated.

Q22
What will be written to the standard output when the following program is run?

class Base {
int i;
Base() {
add(1);
}
void add(int v) {
i += v;
}
void print() {
System.out.println(i);
}
}
class Extension extends Base {
Extension() {
add(2);
}
void add(int v) {
i += v*2;
}
}
public class Qd073 {
public static void main(String args[]) {
bogo(new Extension());
}
static void bogo(Base b) {
b.add(8);
b.print();
}
}

1) 9
2) 18
3) 20
4) 21
5) 22

视频学习

我考网版权与免责声明

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

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

最近更新

社区交流

考试问答