It is impossible to pass Oracle 1Z0-851 exam without any help in the short term. Come to Examcollection soon and find the most advanced, correct and guaranteed Oracle 1Z0-851 practice questions. You will get a surprising result by our Updated Java Standard Edition 6 Programmer Certified Professional Exam practice guides.

♥♥ 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:

Q11. Given the following directory structure: bigProject |--source | | | |--classes |-- And the following command line invocation: javac -d classes source/ Assume the current directory is bigProject, what is the result?

A. If the compile is successful, Utils.class is added to the source directory.

B. The compiler returns an invalid flag error.

C. If the compile is successful, Utils.class is added to the classes directory.

D. If the compile is successful, Utils.class is added to the bigProject directory.

Answer: C

Q12. Given:

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

12. try {

13. args = null;

14. args[0] = "test";

15. System.out.println(args[0]);

16. } catch (Exception ex) {

17. System.out.println("Exception");

18. } catch (NullPointerException npe) {

19. System.out.println("NullPointerException");

20. }

21. }

What is the result?

A. test

B. Exception

C. Compilation fails.

D. NullPointerException

Answer: C



Q14. Click the Exhibit button. Given:

25. try {

26. A a = new A();

27. a.method1();

28. } catch (Exception e) {

29. System.out.print("an error occurred");

30. }

Which two statements are true if a NullPointerException is thrown on line 3 of class C? (Choose two.)

A. The application will crash.

B. The code on line 29 will be executed.

C. The code on line 5 of class A will execute.

D. The code on line 5 of class B will execute.

E. The exception will be propagated back to line 27.

Answer: BE

Q15. Given:

11. public class PingPong implements Runnable {

12. synchronized void hit(long n) {

13. for(int i = 1; i < 3; i++)

14. System.out.print(n + "-" + i + " ");

15. }

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

17. new Thread(new PingPong()).start();

18. new Thread(new PingPong()).start();

19. }

20. public void run() {

21. hit(Thread.currentThread().getId());

22. }

23. }

Which two statements are true? (Choose two.)

A. The output could be 8-1 7-2 8-2 7-1

B. The output could be 7-1 7-2 8-1 6-1

C. The output could be 8-1 7-1 7-2 8-2

D. The output could be 8-1 8-2 7-1 7-2

Answer: CD

Q16. Given:

11. static void test() {

12. try {

13. String x = null;

14. System.out.print(x.toString() + " ");

15. }

16. finally { System.out.print("finally "); }

17. }

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

19. try { test(); }

20. catch (Exception ex) { System.out.print("exception "); }

21. }

What is the result?

A. null

B. finally

C. null finally

D. Compilation fails.

E. finally exception

Answer: E

Q17. Given:

11. class ClassA {}

12. class ClassB extends ClassA {}

13. class ClassC extends ClassA {} and:

21. ClassA p0 = new ClassA();

22. ClassB p1 = new ClassB();

23. ClassC p2 = new ClassC();

24. ClassA p3 = new ClassB();

25. ClassA p4 = new ClassC();

Which three are valid? (Choose three.)

A. p0 = p1;

B. p1 = p2;

C. p2 = p4;

D. p2 = (ClassC)p1;

E. p1 = (ClassB)p3;

F. p2 = (ClassC)p4;

Answer: AEF

Q18. A programmer has an algorithm that requires a java.util.List that provides an efficient implementation of add

(0, object), but does NOT need to support quick random access. What supports these requirements?

A. java.util.Queue

B. java.util.ArrayList

C. java.util.LinearList

D. java.util.LinkedList

Answer: D

Q19. A company that makes Computer Assisted Design (CAD) software has, within its application, some utility classes that are used to perform 3D rendering tasks. The company's chief scientist has just improved the performance of one of the utility classes' key rendering algorithms, and has assigned a programmer to replace the old algorithm with the new algorithm. When the programmer begins researching the utility classes, she is happy to discover that the algorithm to be replaced exists in only one class. The programmer reviews that class's API, and replaces the old algorithm with the new algorithm, being careful that her changes adhere strictly to the class's API. Once testing has begun, the programmer discovers that other classes that use the class she changed are no longer working properly. What design flaw is most likely the cause of these new bugs?

A. Inheritance

B. Tight coupling

C. Low cohesion

D. High cohesion

E. Loose coupling

F. Object immutability

Answer: B

Q20. Given:

1. public class TestOne implements Runnable {

2. public static void main (String[] args) throws Exception {

3. Thread t = new Thread(new TestOne());

4. t.start();

5. System.out.print("Started");

6. t.join();

7. System.out.print("Complete");

8. }

9. public void run() {

10. for (int i = 0; i < 4; i++) {

11. System.out.print(i);

12. }

13. }

14. }

What can be a result?

A. Compilation fails.

B. An exception is thrown at runtime.

C. The code executes and prints "StartedComplete".

D. The code executes and prints "StartedComplete0123".

E. The code executes and prints "Started0123Complete".

Answer: E