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 22676

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

Thread.wait();

Option B

Thread.join();

Option C

Thread.yield();

Option D

Thread.sleep(1);

Option E

Thread.notify();

Correct Answer C,D
Explanation


Question ID 22677

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

Option A

 new Thread() {

public void run() { doStuff(); }
};

Option B

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

Option C

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

Option D

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

Option E

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

Option F

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

Correct Answer D,F
Explanation

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