Chinaunix首页 | 论坛 | 博客
  • 博客访问: 307494
  • 博文数量: 469
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 5200
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-03 16:15
文章分类

全部博文(469)

文章存档

2011年(82)

2010年(284)

2009年(69)

2008年(34)

我的朋友

分类:

2010-04-15 09:42:48

Sun推出的一项重要的考试项目。 SCJP测验您的Java程序设计概念及能力,内容偏重于Java语法及 JDK的内容,现SCJP题库由KillTest认证题库网资深IT认证讲师和SCJP产品专家结合PROMETRICVUE的真实考试环境最新原题倾心打造。题库覆盖了当前最新的真实考题,并且全部附有正确答案。下面是部分的题目:

  1. Which two statements are true? (Choose two.)

A. It is possible for more than two threads to deadlock at once.

B. The JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.

C. Deadlocked threads release once their sleep() method's sleep duration has expired.

D. Deadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.

E. It is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.

F. If a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by

insertinginvocations of Thread.yield().

Answer:AF

2. Click the Exhibit button.What is the output if the main() method is run?

A. 4

B. 5

C. 8

D. 9

E. Compilation fails.

F. An exception is thrown at runtime.

G. It is impossible to determine for certain.

Answer: D

3. Given:

1. public class Threads4 {

2. public static void main (String[] args) {

3. new Threads4().go();

4. }

5. public void go() {

6. Runnable r = new Runnable() {

7. public void run() {

8. System.out.print("foo");

9. }

10. };

11. Thread t = new Thread(r);

12. t.start();

13. t.start();

14. }

15. }

What is the result?

A. Compilation fails.

B. An exception is thrown at runtime.

C. The code executes normally and prints "foo".

D. The code executes normally, but nothing is printed.

Answer: B

4. Which Man class properly represents the relationship "Man has a best friend who is a Dog"?

A. class Man extends Dog { }

B. class Man implements Dog { }

C. class Man { private BestFriend dog; }

D. class Man { private Dog bestFriend; }

E. class Man { private Dog; }

F. class Man { private BestFriend; }

Answer: D

  想要下载更多的SCJP题库资料,你可以到killtest题库网进行下载和咨询!

阅读(168) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~