Our pass rate is high to 98.9% and the similarity percentage between our 1Z0-851 study guide and real exam is 90% based on our seven-year educating experience. Do you want achievements in the Oracle 1Z0-851 exam in just one try? I am currently studying for the Oracle 1Z0-851 exam. Latest Oracle 1Z0-851 Test exam practice questions and answers, Try Oracle 1Z0-851 Brain Dumps First.


♥♥ 2021 NEW RECOMMEND ♥♥

Free VCE & PDF File for Oracle 1Z0-851 Real Exam (Full Version!)

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 1Z0-851 Exam Dumps (PDF & VCE):
Available on: http://www.surepassexam.com/1Z0-851-exam-dumps.html

Q151. Given:

11. class Alpha {

12. public void foo() { System.out.print("Afoo "); }

13. }

14. public class Beta extends Alpha {

15. public void foo() { System.out.print("Bfoo "); }

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

17. Alpha a = new Beta();

18. Beta b = (Beta)a;

19. a.foo();

20. b.foo();

21. }

22. }

What is the result?

A. Afoo Afoo

B. Afoo Bfoo

C. Bfoo Afoo

D. Bfoo Bfoo

E. Compilation fails.

F. An exception is thrown at runtime.

Answer: D


Q152. DRAG DROP

Click the Task button.

Answer:


Q153. Given:

1. public class TestSeven extends Thread {

2. private static int x;

3. public synchronized void doThings() {

4. int current = x;

5. current++;

6. x = current;

7. }

8. public void run() {

9. doThings();

10. }

11.}

Which statement is true?

A. Compilation fails.

B. An exception is thrown at runtime.

C. Synchronizing the run() method would make the class thread-safe.

D. The data in variable "x" are protected from concurrent access problems.

E. Declaring the doThings() method as static would make the class thread-safe.

F. Wrapping the statements within doThings() in a synchronized(new Object()) { } block would make the

class thread-safe.

Answer: E


Q154. Click the Exhibit button. What is the result?

A. go in Goban

go in Sente

B. go in Sente

go in Goban

C. go in Sente

go in Goban

D. go in Goban

go in Sente

E. Compilation fails because of an error in line 17.

Answer: C


Q155. Given a correctly compiled class whose source code is:

1. package com.sun.sjcp;

2. public class Commander {

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

4. // more code here

5. }

6. }

Assume that the class file is located in /foo/com/sun/sjcp/, the current directory is /foo/, and that the

classpath contains "." (current directory). Which command line correctly runs Commander?

A. java Commander

B. java com.sun.sjcp.Commander

C. java com/sun/sjcp/Commander

D. java -cp com.sun.sjcp Commander

E. java -cp com/sun/sjcp Commander

Answer: B


Q156. Given:

1. import java.util.*;

2. public class WrappedString {

3. private String s;

4. public WrappedString(String s) { this.s = s; }

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

6. HashSet<Object> hs = new HashSet<Object>();

7. WrappedString ws1 = new WrappedString("aardvark");

8. WrappedString ws2 = new WrappedString("aardvark");

9. String s1 = new String("aardvark");

10. String s2 = new String("aardvark");

11. hs.add(ws1); hs.add(ws2); hs.add(s1); hs.add(s2);

12. System.out.println(hs.size()); } }

What is the result?

A. 0

B. 1

C. 2

D. 3

E. 4

F. Compilation fails.

G. An exception is thrown at runtime.

Answer: D


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

A. new Thread() {

public void run() { doStuff(); }

};

B. new Thread() {

public void start() { doStuff(); }

};

C. new Thread() {

public void start() { doStuff(); }

}.run();

D. new Thread() {

public void run() { doStuff(); }

}.start();

E. new Thread(new Runnable() {

public void run() { doStuff(); }

}).run();

F. new Thread(new Runnable() {

public void run() { doStuff(); }

}).start();

Answer: DF


Q158. Given:

11. public class Person {

12. private String name, comment;

13. private int age;

14. public Person(String n, int a, String c) {

15. name = n; age = a; comment = c;

16. }

17. public boolean equals(Object o) {

18. if (! (o instanceof Person)) return false;

19, Person p = (Person)o;

20. return age == p.age && name.equals(p.name);

21. }

22. }

What is the appropriate definition of the hashCode method in class Person?

A. return super.hashCode();

B. return name.hashCode() + age * 7;

C. return name.hashCode() + comment.hashCode() / 2;

D. return name.hashCode() + comment.hashCode() / 2 - age * 3;

Answer: B


Q159. Given:

5. class Building { }

6. public class Barn extends Building {

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

8. Building build1 = new Building();

9. Barn barn1 = new Barn();

10. Barn barn2 = (Barn) build1;

11. Object obj1 = (Object) build1;

12. String str1 = (String) build1;

13. Building build2 = (Building) barn1;

14. }

15. }

Which is true?

A. If line 10 is removed, the compilation succeeds.

B. If line 11 is removed, the compilation succeeds.

C. If line 12 is removed, the compilation succeeds.

D. If line 13 is removed, the compilation succeeds.

E. More than one line must be removed for compilation to succeed.

Answer: C


Q160. Given:

1. public class Breaker2 {

2. static String o = "";

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

4. z:

5. for(int x = 2; x < 7; x++) {

6. if(x==3) continue;

7. if(x==5) break z;

8. o = o + x;

9. }

10. System.out.println(o);

11. }

12. }

What is the result?

A. 2

B. 24

C. 234

D. 246

E. 2346

F. Compilation fails.

Answer: B