Want to know Actualtests 1Z0-851 Exam practice test features? Want to lear more about Oracle Java Standard Edition 6 Programmer Certified Professional Exam certification experience? Study Simulation Oracle 1Z0-851 answers to Most recent 1Z0-851 questions at Actualtests. Gat a success with an absolute guarantee to pass Oracle 1Z0-851 (Java Standard Edition 6 Programmer Certified Professional Exam) test on your first attempt.


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

Q81. Given:

10. abstract public class Employee {

11. protected abstract double getSalesAmount();

12. public double getCommision() {

13. return getSalesAmount() * 0.15;

14. }

15. }

16. class Sales extends Employee {

17. // insert method here

18. }

Which two methods, inserted independently at line 17, correctly complete the Sales class? (Choose two.)

A. double getSalesAmount() { return 1230.45; }

B. public double getSalesAmount() { return 1230.45; }

C. private double getSalesAmount() { return 1230.45; }

D. protected double getSalesAmount() { return 1230.45; }

Answer: BD


Q82. Given:

11. public class Test {

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

13. int x = 5;

14. boolean b1 = true;

15. boolean b2 = false;

16.

17. if ((x == 4) && !b2 )

18. System.out.print("1 ");

19. System.out.print("2 ");

20. if ((b2 = true) && b1 )

21. System.out.print("3 ");

22. }

23. }

What is the result?

A. 2

B. 3

C. 1 2

D. 2 3

E. 1 2 3

F. Compilation fails.

G. An exception is thrown at runtime.

Answer: D


Q83. Given a class Repetition:

1. package utils;

2.

3. public class Repetition {

4. public static String twice(String s) { return s + s; }

5. } and given another class Demo:

1. // insert code here

2.

3. public class Demo {

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

5. System.out.println(twice("pizza"));

6. }

7. }

Which code should be inserted at line 1 of Demo.java to compile and run Demo to print "pizzapizza"?

A. import utils.*;

B. static import utils.*;

C. import utils.Repetition.*;

D. static import utils.Repetition.*;

E. import utils.Repetition.twice();

F. import static utils.Repetition.twice;

G. static import utils.Repetition.twice;

Answer: F


Q84. Click the Exhibit button.

Given:

25. A a = new A();

26. System.out.println(a.doit(4, 5));

What is the result?

A. Line 26 prints "a" to System.out.

B. Line 26 prints "b" to System.out.

C. An exception is thrown at line 26 at runtime.

D. Compilation of class A will fail due to an error in line 6.

Answer: A


Q85. Given:

1. public class Mule {

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

3. boolean assert = true;

4. if(assert) {

5. System.out.println("assert is true");

6. }

7. }

8. }

Which command-line invocations will compile?

A. javac Mule.java

B. javac -source 1.3 Mule.java

C. javac -source 1.4 Mule.java

D. javac -source 1.5 Mule.java

Answer: B


Q86. Given:

3. import java.util.*;

4. public class Mapit {

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

6. Set<Integer> set = new HashSet<Integer>();

7. Integer i1 = 45;

8. Integer i2 = 46;

9. set.add(i1);

10. set.add(i1);

11. set.add(i2); System.out.print(set.size() + " ");

12. set.remove(i1); System.out.print(set.size() + " ");

13. i2 = 47;

14. set.remove(i2); System.out.print(set.size() + " ");

15. }

16. }

What is the result?

A. 2 1 0

B. 2 1 1

C. 3 2 1

D. 3 2 2

E. Compilation fails.

F. An exception is thrown at runtime.

Answer: B


Q87. 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


Q88. Given:

1. public class Plant {

2. private String name;

3. public Plant(String name) { this.name = name; }

4. public String getName() { return name; }

5. }

1. public class Tree extends Plant {

2. public void growFruit() { }

3. public void dropLeaves() { }

4. }

Which statement is true?

A. The code will compile without changes.

B. The code will compile if public Tree() { Plant(); } is added to the Tree class.

C. The code will compile if public Plant() { Tree(); } is added to the Plant class.

D. The code will compile if public Plant() { this("fern"); } is added to the Plant class.

E. The code will compile if public Plant() { Plant("fern"); } is added to the Plant class.

Answer: D


Q89. 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);

B. BitUtils.process(bytes);

C. util.BitUtils.process(bytes);

D. SomeApp cannot use methods in BitUtils.

E. import util.BitUtils.*; process(bytes);

Answer: C


Q90. Given that t1 is a reference to a live thread, which is true?

A. The Thread.sleep() method can take t1 as an argument.

B. The Object.notify() method can take t1 as an argument.

C. The Thread.yield() method can take t1 as an argument.

D. The Thread.setPriority() method can take t1 as an argument.

E. The Object.notify() method arbitrarily chooses which thread to notify.

Answer: E