[Free] 2018(Jan) EnsurePass Testinsides Oracle 1z0-854 Dumps with VCE and PDF 11-20

By | January 25, 2018

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

Java Standard Edition 5 Programmer Certified Professional Upgrade Exam

Question No: 11

Given:

  • class Line {

  • public class Point { public int x,y;}

  • public Point getPoint() { return new Point(); }

  • 13. }

    1. class Triangle {

    2. public Triangle() {

    3. // insert code here

    17. }

    18. }

    Which code, inserted at line 16, correctly retrieves a local instance of a Point object?

    1. Point p = (new Line()).getPoint();

    2. Line.Point p = Line.getPoint();

    3. Point p = Line.getPoint();

    4. Line.Point p = (new Line()).getPoint();

    Answer: D

    Question No: 12

    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())

    9. 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;N extends Objectgt; {

    3. public class MinMaxlt;N extends Integergt; {

    4. public class MinMaxlt;? extends Objectgt; {

    5. public class MinMaxlt;N extends Numbergt; {

    6. public class MinMaxlt;? extends Numbergt; {

    Answer: C,E

    Question No: 13

    A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar.

    Which three, taken independently, will allow the developer to use the Paper class while

    compiling the Book class? (Choose three.)

    1. The JAR file is located at $JAVA_HOME/jre/classes/myLib.jar.

    2. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -d

      /foo/myLib.jar Book.java

    3. The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class.

    4. The JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar..

    5. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac – classpath /foo/myLib.jar Book.java

    6. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -cp

      /foo/myLib.jar/Paper Book.java.

    7. The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar.

    Answer: D,E,G

    Question No: 14

    Given:

    1. public class SuperCalc {

    2. protected static int multiply(int a, int b) { return a * b;}

    12. } and:

    1. public class SubCalc extends SuperCalc{

    2. public static int multiply(int a, int b) {

    3. int c = super.multiply(a, b);

    4. return c;

    24. }

    25. } and:

    1. SubCalc sc = new SubCalc ();

    2. System.out.println(sc.multiply(3,4));

    3. System.out.println(SubCalc.multiply(2,2)); What is the result?

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

    2. The code runs with no output.

    3. 12 4

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

    5. An exception is thrown at runtime.

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

    Answer: D

    Question No: 15

    Given:

    1. NumberFormat nf = NumberFormat.getInstance();

    2. nf.setMaximumFractionDigits(4);

    3. nf.setMinimumFractionDigits(2);

    4. String a = nf.format(3.1415926);

    5. String b = nf.format(2);

    Which two statements are true about the result if the default locale is Locale.US? (Choose two.)

    1. The value of a is 3.1415.

    2. The value of a is 3.14.

    3. The value of a is 3.141.

    4. The value of b is 2.

    5. The value of b is 2.0000.

    6. The value of a is 3.1416.

    7. The value of b is 2.00.

    Answer: F,G

    Question No: 16

    Click the Exhibit button.

    Which statement is true about the two classes?

    Ensurepass 2018 PDF and VCE

    1. Compilation of class B will fail. Compilation of class A will succeed.

    2. Compilation of class A will fail. Compilation of class B will succeed.

    3. Compilation of both classes will fail.

    4. Compilation of both classes will succeed.

    Answer: A

    Question No: 17

    Given:

    1. class ClassA {}

    2. class ClassB extends ClassA {}

    3. class ClassC extends ClassA {} and:

    1. ClassA p0 = new ClassA();

    2. ClassB p1 = new ClassB();

    3. ClassC p2 = new ClassC();

    4. ClassA p3 = new ClassB();

    5. ClassA p4 = new ClassC();

    Which three are valid? (Choose three.)

    1. p2 = p4;

    2. p2 = (ClassC)p1;

    3. p0 = p1;

    4. p2 = (ClassC)p4;

    5. p1 = p2;

    6. p1 = (ClassB)p3;

    Answer: C,D,F

    Question No: 18

    Given this method in a class:

    1. public String toString() {

    2. StringBuffer buffer = new StringBuffer();

    3. buffer.append(#39;lt;#39;);

    4. buffer.append(this.name);

    5. buffer.append(#39;gt;#39;);

    6. return buffer.toString();

    27. }

    Which statement is true?

    1. This code will perform well and converting the code to use StringBuilder will not enhance the performance.

    2. This code will perform poorly. For better performance, the code should be rewritten: return quot;lt;quot; this.name quot;gt;quot;;

    3. This code is NOT thread-safe.

    4. The programmer can replace StringBuffer with StringBuilder with no other changes.

    Answer: D

    Question No: 19 DRAG DROP

    Click the Task button.

    Ensurepass 2018 PDF and VCE

    Answer:

    Ensurepass 2018 PDF and VCE

    Question No: 20

    Click the Exhibit button.

    What two must the programmer do to correct the compilation errors? (Choose two.)

    Ensurepass 2018 PDF and VCE

    1. change the wheelCount variable in Car to protected

    2. insert a call to this() in the MeGo constructor

    3. insert a call to this() in the Car constructor

    4. insert a call to super(vin) in the MeGo constructor

    5. insert a call to super() in the MeGo constructor

    6. change line 3 in the MeGo class to super.wheelCount = 3;

    Answer: A,D

    100% Ensurepass Free Download!
    Download Free Demo:1z0-854 Demo PDF
    100% Ensurepass Free Guaranteed!
    1z0-854 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

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