310-065 Exam Resources

1. Given:
1. public class Threads2 implements Runnable {
2.
3. public void run() {
4. System.out.println("run.");
5. throw new RuntimeException("Problem");
6. }
7. public static void main(String[] args) {
8. Thread t = new Thread(new Threads2());
9. t.start();
10. System.out.println("End of method.");
11. }
12. }
Which two can be results? (Choose two.)
A. java.lang.RuntimeException: Problem
B. run. java.lang.RuntimeException: Problem
C. End of method. java.lang.RuntimeException: Problem
D. End of method. run. java.lang.RuntimeException: Problem
E. run. java.lang.RuntimeException: ProblemEnd of method.
Answer: DE

 

2. 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

 

3. Given:
7.void waitForSignal() {
8.Object obj = new Object();
9.synchronized (Thread.currentThread()) {
10.obj.wait();
11.obj.notify();
12.}
13.}
Which statement is true?
A. This code can throw an InterruptedException.
B. This code can throw an IllegalMonitorStateException.
C. This code can throw a TimeoutException after ten minutes.
D. Reversing the order of obj.wait() and obj.notify() might cause this method to complete normally.
E. A call to notify() or notifyAll() from another thread might cause this method to complete normally.
F. This code does NOT compile unless "obj.wait()" is replaced with "((Thread) obj).wait()".
Answer: B

 

4. Click the Exhibit button.What is the output if the main() method is run?
Given:
10. public class Starter extends Thread {
11. private int x = 2;
12. public static void main(String[] args) throws Exception {
13. new Starter().makeItSo();
14. }
15. public Starter() {
16. x = 5;
17. start();
18. }
19. public void makeItSo() throws Exception {
20. join();
21. x = x - 1;
22. System.out.println(x);
23. }
24. public void run() { x *= 2; }
25. }
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

 

5. Given:
11.class PingPong2 {
12.synchronized void hit(long n) {
13.for(int i = 1; i < 3; i++)
14.System.out.print(n + "-" + i + " ");
15.}
16.}
17.public class Tester implements Runnable {
18.static PingPong2 pp2 = new PingPong2();
19.public static void main(String[] args) {
20.new Thread(new Tester()).start();
21.new Thread(new Tester()).start();
22.}
23.public void run() { pp2.hit(Thread.currentThread().getId()); }
24.}
Which statement is true?
A. The output could be 5-1 6-1 6-2 5-2
B. The output could be 6-1 6-2 5-1 5-2
C. The output could be 6-1 5-2 6-2 5-1
D. The output could be 6-1 6-2 5-1 7-1
Answer: B

 

6. 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

 

7. Given:
11. public abstract class Shape {
12. private int x;
13. private int y;
14. public abstract void draw();
15. public void setAnchor(int x, int y) {
16. this.x = x;
17. this.y = y;
18. }
19. }
Which two classes use the Shape class correctly? (Choose two.)
A. public class Circle implements Shape {private int radius; }
B. public abstract class Circle extends Shape { private int radius; }
C. public class Circle extends Shape { private int radius; public void draw(); }
D. public abstract class Circle implements Shape { private int radius; public void draw(); }
E. public class Circle extends Shape { private int radius; public void draw() {/* code here */}
F. public abstract class Circle implements Shape { private int radius; public void draw() { /* code here */ }
Answer: BE

 

8. Given:
11. public class Barn {
12. public static void main(String[] args) {
13. new Barn().go("hi", 1);
14. new Barn().go("hi", "world", 2);
15. }
16. public void go(String... y, int x) {
17. System.out.print(y[y.length - 1] + " ");
18. }
19. }
What is the result?
A. hi hi
B. hi world
C. world world
D. Compilation fails.
E. An exception is thrown at runtime.
Answer: D

 

9.Given:
10 class Nav{
11. public enum Direction { NORTH, SOUTH, EAST, WEST }
12. }
13. public class Sprite{
14. // insert code here
15. }
Which code, inserted at line 14, allows the Sprite class to compile?
A. Direction d = NORTH;
B. Nav.Direction d = NORTH;
C. Direction d = Direction.NORTH;
D. Nav.Direction d = Nav.Direction.NORTH;
Answer: D

 

10. Click the Exhibit button.
1. public interface A {
2. public void doSomething(String thing);
3. }
1. public class AImpl implements A {
2. public void doSomething(String msg) { }
3. }
1. public class B {
2. public A doit() {
3. // more code here
4. }
5.
6. public String execute() {
7. // more code here
8. }
9. }
1. public class C extends B {
2. public AImpl doit() {
3. // more code here
4. }
5.
6. public Object execute() {
7. // more code here
8. }
9. }
Which statement is true about the classes and interfaces in the exhibit?
A. Compilation will succeed for all classes and interfaces.
B. Compilation of class C will fail because of an error in line 2.
C. Compilation of class C will fail because of an error in line 6.
D. Compilation of class AImpl will fail because of an error in line 2.
Answer: C


优惠考生:QQ:1742406401

支持支付宝付款,送免费最新题库,确保考试无忧

Sun Solaris&JAVA通用券:
   
可以考310系列(除程序设计题310-252A/310-301A之外)Sun所有考试科目,在全国普尔文(Prometric)考试中心都可以注册使用考试。

官网申请价格:898元

限时售价500元/张  团购更优惠

推荐注册考试科目简介

Sun Java 技术资格认证考试
Sun Java认证助理程序员(SCJA)
Sun Java平台标准版认证助理程序员考试1.0版(CX-310-019)
Sun Java认证程序员(SCJP)
Sun Java平台标准版6认证程序员(CX-310-065)
升级考试:Sun Java Platform, Standard Edition 6 认证程序员 (CX-310-066)
Sun Java 平台标准版 5.0 认证程序员考试 (CX-310-055)
Sun Java 平台标准版 5.0 认证程序员升级考试 (CX-310-056)
Sun Web组件认证开发人员(SCWCD)
Sun Java Platform, Enterprise Edition 5 Web 组件认证开发工程师 (CX-310-083)
升级考试:Sun Java Platform, Enterprise Edition 5 认证 Web 组件开发人员 (CX-310-084)
Sun商务组件认证开发人员(SCBCD)
Sun Java平台企业版5认证商务组件开发人员 (CX-310-091)
升级考试:Sun Java Platform, Enterprise Edition 5 认证商务组件开发工程师 (CX-310-092)
Sun Java Web 服务认证开发人员 (SCDJWS)
Sun Java Web 服务认证开发人员 (CX-310-230) - 更新到 JAVA EE5!
Sun Java Web服务认证开发人员(CX-310-220)
Sun 认证企业架构师 (SCEA)
Sun Java Platform, Enterprise Edition 5 认证企业架构师(步骤 1,共 3 步)(CX-310-052)
升级考试:Sun Java Platform, Enterprise Edition 5 认证企业架构师 (CX-310-053)
Sun 认证移动应用开发人员 (SCMAD)
Sun Java 2平台微型版认证移动应用开发人员1.0版(CX-310-110)
Sun NetBeans IDE 资格认证考试
Sun NetBeans IDE 认证专家 (CX-310-045) - 最新!
Sun Solaris 操作系统资格认证考试Sun 认证
Solaris 助理 (SCSAS)
Sun 认证 Solaris 助理 (CX-310-105) - 最新
Sun 认证系统管理员 (SCSA)
Solaris 10操作系统
Sun Solaris 10操作系统认证系统管理员第一部分(CX-310-200)
Sun Solaris 10操作系统认证系统管理员第二部分考试(CX-310-202)
Sun Solaris 10 操作系统认证系统管理员升级考试 (CX-310-203)
Solaris 9 操作系统
Sun Solaris 9操作系统认证系统管理员(第一部分,共两部分)考试(CX-310-014)
Sun Solaris 9操作系统认证系统管理员(第二部分,共二部分)考试(CX-310-015)
Sun Solaris 9操作系统认证系统管理员升级考试(CX-310-016)
Sun认证网络管理员(SCNA)
Solaris 10操作系统
Sun Solaris 10操作系统认证网络管理员(CX-310-302)
Solaris 9 操作系统
Sun Solaris 9操作系统认证网络管理员(CX-310-044)
Sun 认证安全管理员 (SCSECA)
Solaris 10操作系统
Sun Solaris 10 操作系统认证安全管理员 (CX-310-303)
Solaris 9 操作系统
Sun Solaris 9操作系统认证安全管理员(CX-310-301)
Sun Cluster 软件资格认证考试
Sun Cluster 3.2 软件认证系统管理员考试 (CX-310-345)
Sun JCAPS 资格认证考试
Sun 认证 JCAPS 集成工程师 (CX-310-502) ?
Sun 身份管理资格认证考试
Sun 认证 Identity Manager 7.1 集成商 (CX-310-400) - 最新

团购更优惠!5人以上可团购!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值