KILLTESTは310-065科目の更新版をリリースしました、310-065試験 はSUN 会社に主催されて、高い権威が持っています。貴方がもし310-065試験を通したら、もう先進的な技術を修得したことを表明します。だから最近310-065試験を受ける人もますます多くなって、それに応じていい学習資料もだんだん必要となっています。KILLTESTの310-065問題集 が申し分のない学習資料と思います、この問題集を使って合格することを保証します、万が一不合格になる場合全額返済します。
310-065の問題集皆と分かち合います
5. Given:
1. class PingPong2 {
2. synchronized void hit(long n) {
3. for(int i = 1; i < 3; i++)
4. System.out.print(n + "-" + i + " ");
5. }
6. }
7. public class Tester implements Runnable {
8. static PingPong2 pp2 = new PingPong2();
9. public static void main(String[] args) {
10. new Thread(new Tester()).start();
11. new Thread(new Tester()).start();
12. }
13. public void run() { pp2.hit(Thread.currentThread().getId()); }
14. }
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:
1. public abstract class Shape {
2. private int x;
3. private int y;
4. public abstract void draw();
5. public void setAnchor(int x, int y) {
6. this.x = x;
7. this.y = y;
8. }
9. }
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