It is more faster and easier to pass the Oracle 1Z0-851 exam by using Refined Oracle Java Standard Edition 6 Programmer Certified Professional Exam questuins and answers. Immediate access to the Most up-to-date 1Z0-851 Exam and find the same core area 1Z0-851 questions with professionally verified answers, then PASS your exam with a high score now.

2021 Sep java se 6 programmer certified professional exam 1z0-851 dumps:

Q111. Given:

3. import java.util.*;

4. public class G1 {

5. public void takeList(List<? extends String> list) {

6. // insert code here

7. }

8. }

Which three code fragments, inserted independently at line 6, will compile? (Choose three.)

A. list.add("foo");

B. Object o = list;

C. String s = list.get(0);

D. list = new ArrayList<String>();

E. list = new ArrayList<Object>();

Answer: BCD


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


Q113. Click the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result?


A. Compilation fails.

B. ClassC is displayed.

C. The code runs with no output.

D. An exception is thrown at runtime.

Answer: D


Q114. Given:

2. public class Hi {

3. void m1() { }

4. protected void() m2 { }

5. }

6. class Lois extends Hi {

7. // insert code here

8. }

Which four code fragments, inserted independently at line 7, will compile? (Choose four.)

A. public void m1() { }

B. protected void m1() { }

C. private void m1() { }

D. void m2() { }

E. public void m2() { }

F. protected void m2() { }

G. private void m2() { }

Answer: ABEF


Q115. Given:

11. public class Person {

12. private name;

13. public Person(String name) {

14. this.name = name;

15. }

16. public int hashCode() {

17. return 420;

18. }

19. }

Which statement is true?

A. The time to find the value from HashMap with a Person key depends on the size of the map.

B. Deleting a Person key from a HashMap will delete all map entries for all keys of type Person.

C. Inserting a second Person object into a HashSet will cause the first Person object to be removed as a

duplicate.

D. The time to determine whether a Person object is contained in a HashSet is constant and does NOT

depend on the size of the map.

Answer: A


2passeasy.com

Abreast of the times oracle 1z0-851 certification:

Q116. 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();

B. Thread.join();

C. Thread.yield();

D. Thread.sleep(1);

E. Thread.notify();

Answer: CD


Q117. Given:

11. String test = "Test A. Test B. Test C.";

12. // insert code here

13. String[] result = test.split(regex);

Which regular expression, inserted at line 12, correctly splits test into "Test A", "Test B", and "Test C"?

A. String regex = "";

B. String regex = " ";

C. String regex = ".*";

D. String regex = "\s";

E. String regex = "\.\s*";

F. String regex = "\w[ .] +";

Answer: E


Q118. Given:

10. interface Data { public void load(); }

11. abstract class Info { public abstract void load(); }

Which class correctly uses the Data interface and Info class?

A. public class Employee extends Info implements Data { public void load() { /*do something*/ }

}

B. public class Employee implements Info extends Data { public void load() { /*do something*/ }

}

C. public class Employee extends Info implements Data { public void load(){ /*do something*/ }

public void Info.load(){ /*do something*/ }

}

D. public class Employee implements Info extends Data { public void Data.load(){ /*do something*/ }

public void load(){ /*do something*/ }

}

E. public class Employee implements Info extends Data { public void load(){ /*do something*/ }

public void Info.load(){ /*do something*/ }

}

F. public class Employee extends Info implements Data{

public void Data.load() { /*do something*/ }

public void Info.load() { /*do something*/ }

}

Answer: A


Q119. Given:

1. public class Base {

2. public static final String FOO = "foo";

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

4. Base b = new Base();

5. Sub s = new Sub();

6. System.out.print(Base.FOO);

7. System.out.print(Sub.FOO);

8. System.out.print(b.FOO);

9. System.out.print(s.FOO);

10. System.out.print(((Base)s).FOO);

11. } }

12. class Sub extends Base {public static final String FOO="bar";}

What is the result?

A. foofoofoofoofoo

B. foobarfoobarbar

C. foobarfoofoofoo

D. foobarfoobarfoo

E. barbarbarbarbar

F. foofoofoobarbar

G. foofoofoobarfoo

Answer: D


Q120. Given:

11. // insert code here

12. private N min, max;

13. public N getMin() { return min; }

14. public N getMax() { return max; }

15. public void add(N added) {

16. if (min == null || added.doubleValue() < min.doubleValue())

17. min = added;

18. if (max == null || added.doubleValue() > max.doubleValue()) 19. max = added;

20. }

21. }

Which two, inserted at line 11, will allow the code to compile? (Choose two.)

A. public class MinMax<?> {

B. public class MinMax<? extends Number> {

C. public class MinMax<N extends Object> {

D. public class MinMax<N extends Number> {

E. public class MinMax<? extends Object> {

F. public class MinMax<N extends Integer> {

Answer: DF