Given:
10.
interface A { void x(); }
11.
class B implements A { public void x() {} public void y() {} }
12.
class C extends B { public void x() {} } And:
20.
java.util.List list = new java.util.ArrayList();
21.
list.add(new B());
22.
list.add(new C());
23.
for (A a : list) {
24.
a.x();
25.
a.y();
26.
}
What is the result?
A. The code runs with no output.Given classes defined in two different files:
1. package util;
2. public class BitUtils {
3. public static void process(byte[] b) { /* more code here */ }
4. }
1. package app;
2. public class SomeApp {
3. public static void main(String[] args) {
4. byte[] bytes = new byte[256];
5. // insert code here
6. }
7. }
What is required at line 5 in class SomeApp to use the process method of BitUtils?
A. process(bytes);Given:
11.
public interface A { public void m1(); }
12.
13.
class B implements A { }
14.
class C implements A { public void m1() { } }
15.
class D implements A { public void m1(int x) { } }
16.
abstract class E implements A { }
17.
abstract class F implements A { public void m1() { } }
18.
abstract class G implements A { public void m1(int x) { } }
What is the result?
A. Compilation succeeds.DRAG DROP
Select and Place:

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();Given that the current directory is empty, and that the user has read and write privileges to the current directory, and the following:
1.
import java.io.*;
2.
public class Maker {
3.
public static void main(String[] args) {
4.
File dir = new File("dir");
5.
File f = new File(dir, "f");
6.
}
7.
}
Which statement is true?
A. Compilation fails.Given:
11.
static void test() throws RuntimeException {
12.
try {
13.
System.out.print("test ");
14.
throw new RuntimeException();
15.
}
16.
catch (Exception ex) { System.out.print("exception "); }
17.
}
18.
public static void main(String[] args) {
19.
try { test(); }
20.
catch (RuntimeException ex) { System.out.print("runtime "); }
21.
System.out.print("end ");
22.
}
What is the result?
A. test endGiven:
1.
interface DoStuff2 {
2.
float getRange(int low, int high); }
3.
4.
interface DoMore {
5.
float getAvg(int a, int b, int c); }
6.
7.
abstract class DoAbstract implements DoStuff2, DoMore { } 8.
9.
class DoStuff implements DoStuff2 {
10.
public float getRange(int x, int y) { return 3.14f; } } 11.
12.
interface DoAll extends DoMore {
13.
float getAvg(int a, int b, int c, int d); }
What is the result?
A. The file will compile without error.Click the Exhibit button. What is the result?

Given:
1.
public class Threads5 {
2.
public static void main (String[] args) {
3.
new Thread(new Runnable() {
4.
public void run() {
5.
System.out.print("bar");
6.
}}).start();
7.
}
8.
}
What is the result?
A. Compilation fails.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.