[Free] 2018(Jan) EnsurePass Dumpsleader Oracle 1z0-851 Dumps with VCE and PDF 91-100

Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-851
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-851.html

Java Standard Edition 6 Programmer Certified Professional Exam

Question No: 91 – (Topic 1)

Given:

  1. public interface A111 {

  2. String s = quot;yoquot;;

  3. public void method1();

14. }

17. interface B { }

  1. interface C extends A111, B {

  2. public void method1();

  3. public void method1(int x);

23. }

What is the result?

  1. Compilation succeeds.

  2. Compilation fails due to multiple errors.

  3. Compilation fails due to an error only on line 20.

  4. Compilation fails due to an error only on line 21.

  5. Compilation fails due to an error only on line 22.

  6. Compilation fails due to an error only on line 12.

    Answer: A

    Question No: 92 – (Topic 1)

    Given:

    1. interface TestA { String toString(); }

    2. public class Test {

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

    4. System.out.println(new TestA() {

    5. public String toString() { return quot;testquot;; } 6. });

      7. }

      8. }

      What is the result?

      1. test

      2. null

      3. An exception is thrown at runtime.

      4. Compilation fails because of an error in line 1.

      5. Compilation fails because of an error in line 4.

      6. Compilation fails because of an error in line 5.

Answer: A

Question No: 93 – (Topic 1)

Given:

  1. class Alpha {

  2. public void foo() { System.out.print(quot;Afoo quot;); }

13. }

  1. public class Beta extends Alpha {

  2. public void foo() { System.out.print(quot;Bfoo quot;); }

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

  4. Alpha a = new Beta();

  5. Beta b = (Beta)a;

  6. a.foo();

  7. b.foo();

21. }

22. }

What is the result?

  1. Afoo Afoo

  2. Afoo Bfoo

  3. Bfoo Afoo

  4. Bfoo Bfoo

  5. Compilation fails.

  6. An exception is thrown at runtime.

Answer: D

Question No: 94 – (Topic 1)

Given:

  1. abstract public class Employee {

  2. protected abstract double getSalesAmount();

  3. public double getCommision() {

  4. return getSalesAmount() * 0.15;

14. }

15. }

  1. class Sales extends Employee {

  2. // insert method here

18. }

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

  1. double getSalesAmount() { return 1230.45; }

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

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

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

Answer: B,D

Question No: 95 – (Topic 1)

Click the Exhibit button. What is the result?

Ensurepass 2018 PDF and VCE

A. 4321

B. 0000

  1. An exception is thrown at runtime.

  2. Compilation fails because of an error in line 18.

    Answer: D

    Question No: 96 – (Topic 1)

    Given:

    1. import java.util.*;

    2. public class Mapit {

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

    4. Setlt;Integergt; set = new HashSetlt;Integergt;();

    5. Integer i1 = 45;

    6. Integer i2 = 46;

    7. set.add(i1);

    8. set.add(i1);

    9. set.add(i2); System.out.print(set.size() quot; quot;);

    10. set.remove(i1); System.out.print(set.size() quot; quot;); 13. i2 = 47;

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

    15. }

    16. }

    What is the result?

    A. 2 1 0

    B. 2 1 1

    C. 3 2 1

    D. 3 2 2

  3. Compilation fails.

  4. An exception is thrown at runtime.

    Answer: B

    Question No: 97 – (Topic 1)

    Given:

    1. public class Score implements Comparablelt;Scoregt; {

    2. private int wins, losses;

    3. public Score(int w, int l) { wins = w; losses = l; }

    4. public int getWins() { return wins; }

    5. public int getLosses() { return losses; }

    6. public String toString() {

    7. return quot;lt;quot; wins quot;,quot; losses quot;gt;quot;; 8. }

  1. // insert code here

    10. }

    Which method will complete this class?

    1. public int compareTo(Object o){/*more code here*/}

    2. public int compareTo(Score other){/*more code here*/}

    3. public int compare(Score s1,Score s2){/*more code here*/}

    4. public int compare(Object o1,Object o2){/*more code here*/}

Answer: B

Question No: 98 – (Topic 1)

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?

  1. java.util.Queue

  2. java.util.ArrayList

  3. java.util.LinearList

  4. java.util.LinkedList

Answer: D

Question No: 99 – (Topic 1)

Given:

  1. import java.util.*;

  2. public class Explorer3 {

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

  4. TreeSetlt;Integergt; s = new TreeSetlt;Integergt;();

  5. TreeSetlt;Integergt; subs = new TreeSetlt;Integergt;(); 17. for(int i = 606; i lt; 613; i )

18. if(i%2 == 0) s.add(i);

  1. subs = (TreeSet)s.subSet(608, true, 611, true);

  2. subs.add(629);

  3. System.out.println(s quot; quot; subs);

22. }

23. }

What is the result?

  1. Compilation fails.

  2. An exception is thrown at runtime.

C. [608, 610, 612, 629] [608, 610]

D. [608, 610, 612, 629] [608, 610, 629]

E. [606, 608, 610, 612, 629] [608, 610]

F. [606, 608, 610, 612, 629] [608, 610, 629]

Answer: B

Question No: 100 – (Topic 1)

Given:

  1. // insert code here

  2. private N min, max;

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

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

  5. public void add(N added) {

  6. if (min == null || added.doubleValue() lt; min.doubleValue())

  7. min = added;

  8. if (max == null || added.doubleValue() gt; max.doubleValue()) 19. max = added;

20. }

21. }

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

  1. public class MinMaxlt;?gt; {

  2. public class MinMaxlt;? extends Numbergt; {

  3. public class MinMaxlt;N extends Objectgt; {

  4. public class MinMaxlt;N extends Numbergt; {

  5. public class MinMaxlt;? extends Objectgt; {

  6. public class MinMaxlt;N extends Integergt; {

Answer: D,F

Topic 2, Volume B

100% Ensurepass Free Download!
Download Free Demo:1z0-851 Demo PDF
100% Ensurepass Free Guaranteed!
1z0-851 Dumps

EnsurePass ExamCollection Testking
Lowest Price Guarantee Yes No No
Up-to-Dated Yes No No
Real Questions Yes No No
Explanation Yes No No
PDF VCE Yes No No
Free VCE Simulator Yes No No
Instant Download Yes No No

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.