AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-851





Question ID 3897

Given that Triangle implements Runnable, and:
31.    void go() throws Exception {
32.    Thread t = new Thread(new Triangle());
33.    t.start();
34.    for(int x = 1; x < 100000; x++) {
35.    //insert code here
36.    if(x%100 == 0) System.out.print("g");
37.    } }
38.    public void run() {
39.    try {
40.    for(int x = 1; x < 100000; x++) {
41.    // insert the same code here
42.    if(x%100 == 0) System.out.print("t");
43.    }
44.    } catch (Exception e) { }
45.    }
Which two statements, inserted independently at both lines 35 and 41, tend to allow both threads to temporarily pause and allow the other thread to execute? (Choose two.)
 

Option A

A.    Thread.wait();
 

Option B

B.    Thread.join();
 

Option C

C.    Thread.yield();
 

Option D

D.    Thread.sleep(1);
 

Correct Answer C,D
Explanation


Question ID 3898

Which two code fragments will execute the method doStuff() in a separate thread? (Choose two.)
 

Option A

A.    new Thread() {
public void run() { doStuff(); } };
 

Option B

B.    new Thread() {
public void start() { doStuff(); } };
 

Option C

C.    new Thread() {
public void start() { doStuff(); } }.run();
 

Option D

D.    new Thread() {
public void run() { doStuff(); } }.start();
 

Option E

E.    new Thread(new Runnable() { public void run() { doStuff(); } }).run();
 

Option F

F.    new Thread(new Runnable() { public void run() { doStuff(); } }).start();
 

Correct Answer D,F
Explanation

Send email to admin@getfreedumps for new dumps request!!!