별의 공부 블로그 🧑🏻‍💻
728x90
728x170

QUESTION 21

Select and Place:

 

 

Correct Answer:

 

 

 

Section: All Explanation

 

Explanation/Reference:


 

QUESTION 22

 

 

Select and Place:

 

 

 

Correct Answer:

 

 

 

Section: All Explanation

 

Explanation/Reference:


 

QUESTION 23

 

 

Select and Place:

 

 

 

Correct Answer:

 

 

 

Section: (none) Explanation

 

Explanation/Reference:

 

QUESTION 24

Place the correct description of the compiler output on the code fragments to be inserted at lines 4 and 5. The same compiler output may be used more than once.

 

1.   import java.util.*;


 

2.   public class X {

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

4.             // insert code here

5.             // insert code here

06.    }

07.    public static void foo(List<Object> list) { }

08. }

 

Select and Place:

 

 

 

 

Correct Answer:

 

 

 

Section: All Explanation

 

Explanation/Reference:

 

 

QUESTION 25

Place the code fragments into position to produce the output:

 

true true false

 

Select and Place:

 

 

Correct Answer:

 

 

 

Section: All Explanation

 

Explanation/Reference:

 

 

QUESTION 26

Given:

 

class A {

String name = "A";

 

String getName() {

return name;

}

 

String greeting() {

return "class A";

}

}

 

class B extends A { String name = "B";

 

String greeting() {


 

return "class B";

}

}

 

public class Client {

public static void main(String[] args) { A a = new A();

A b = new B();

System.out.println(a.greeting() + " has name " + a.getName()); System.out.println(b.greeting() + " has name " + b.getName());

}

}

 

Select and Place:

 

 

 

Correct Answer:

 

 

 

Section: All Explanation

 

Explanation/Reference:

 

 

QUESTION 27

Place the code elements in positions so that the Flags2 class will compile and make appropriate use of the wait/notify mechanism. Note: You may reuse code elements.

 

Select and Place:

 

 

 

Correct Answer:

 

 

Section: All Explanation

 

Explanation/Reference:

 

 

QUESTION 28

Given:

 

Runnable r = new Runnable() { public void run() {

try {


 

Thread.sleep(1000);

} catch (interruptedException e) { System.out.println("interrupted");

}

System.out.println("ran");

}

};

Thread t = new Thread(r); t.start(); System.out.println("started"); t.sleep(2000); System.out.println("interrupting"); t.interrupt(); System.out.println("ended");

 

Assue that sleep(n) executes in exactly n milliseconds, and all other code executes in an insignificant amount of time. Place the fragments in the output area to show the result of running this  code.

 

Select and Place:

 

 

 

Correct Answer:

 

 

 

Section: All Explanation

 

Explanation/Reference:

 

 

QUESTION 29

Add methods to the Beta class to make it compile correctly.

 

Select and Place:

 

 

Correct Answer:

 

 

Section: All Explanation

 

Explanation/Reference:

 

 

QUESTION 30

Place the code fragments in position to complete the Displayable interface.

 

Select and Place:

 

 

 

Correct Answer:

 

 

Section: All Explanation

 

Explanation/Reference:

 

 

 

 


Source from : Oracle.Exactexams.1z0-851.v2013-11-27.by.SomeBody ().

728x90
그리드형(광고전용)

'Certificate > OCAJP' 카테고리의 다른 글

[1Z0-808][OCAJP] Dump 문제 21~30  (0) 2022.01.02
[1Z0-808][OCAJP] Dump 문제 11~20  (0) 2022.01.02
[1Z0-808][OCAJP] Dump 문제 1~10  (2) 2021.12.31
[1Z0-851][OCAJP] Dump 문제 1~10  (0) 2021.12.30
[1Z0-851E] Question 11~20  (0) 2017.08.15
[1Z0-851E] Question 01~10  (0) 2017.08.15
[1Z0-851D] Question 41~50  (0) 2017.08.13
[1Z0-851D] Question 31~40  (0) 2017.08.13
⚠️AdBlock이 감지되었습니다. 원할한 페이지 표시를 위해 AdBlock을 꺼주세요.⚠️


📖 Contents 📖