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.)
A. Thread.wait();DRAG DROP
Select and Place:

Select and Place:

Given:
1.
public class Threads3 implements Runnable {
2.
public void run() {
3.
System.out.print("running");
4.
}
5.
public static void main(String[] args) {
6.
Thread t = new Thread(new Threads3());
7.
t.run();
8.
t.run();
9.
t.start();
10.
}
11.
}
What is the result?
A. Compilation fails.Given
11 public interface Status {
12 /* insert code here */ int MY_VALUE = 10;
13 } Which three are valid on line
12?
(Choose three.)
A. finalGiven:
1.
public class GC {
2.
private Object o;
3.
private void doSomethingElse(Object obj) { o = obj; }
4.
public void doSomething() {
5.
Object o = new Object();
6.
doSomethingElse(o);
7.
o = new Object();
8.
doSomethingElse(null);
9.
o = null;
10.
}
11.
}
When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?
A. Line 5Given:
1.
public class BuildStuff {
2.
public static void main(String[] args) {
3.
Boolean test = new Boolean(true);
4.
Integer x = 343;
5.
Integer y = new BuildStuff().go(test, x);
6.
System.out.println(y);
7.
}
8.
int go(Boolean b, int i) {
9.
if(b) return (i/7);
10.
return (i/49);
11.
}
12.
}
What is the result?
A. 7Which two statements are true? (Choose two.)
A. It is possible for more than two threads to deadlock at once.Given:
11.
class Converter {
12.
public static void main(String[] args) {
13.
Integer i = args[0];
14.
int j = 12;
15.
System.out.println("It is " + (j==i) + " that j==i.");
16.
}
17.
}
What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?
A. It is true that j==i.DRAG DROP
Select and Place:

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Oracle exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 1Z0-851 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.