[Free] 2018(Jan) EnsurePass Testking Oracle 1z0-853 Dumps with VCE and PDF 161-170

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

Java Standard Edition 5 Programmer Certified Professional Exam

Question No: 161 – (Topic 2)

Given:

  1. public abstract class Shape {

  2. int x;

  3. int y;

  4. public abstract void draw();

  5. public void setAnchor(int x, int y) {

  6. this.x = x;

  7. this.y = y;

18. }

19. }

and a class Circle that extends and fully implements the Shape class. Which is correct?

  1. Shape s = new Circle();

  2. setAnchor(10,10);

  3. draw();

  4. Circle c = new Circle();

  5. Shape.setAnchor(10,10);

  6. Shape.draw();

  7. Circle c = new Shape();

  8. setAnchor(10,10);

  9. draw();

  10. Shape s = new Shape();

  11. setAnchor(10,10);

  12. draw();

  13. Shape s = new Circle(); s-gt;setAnchor(10,10);

s-gt;draw();

Answer: A

Question No: 162 – (Topic 2)

Given:

enum Example { ONE, TWO, THREE } Which statement is true?

  1. The Example values can be used in a java.util.SortedSet, but the set will NOT be sorted because enumerated types do NOT implement java.lang.Comparable.

  2. The expressions (ONE == ONE) and ONE.equals(ONE) are both guaranteed to be true.

  3. The Example values cannot be used in a raw java.util.HashMap; instead, the programmer must use a java.util.EnumMap.

  4. The expression (ONE lt; TWO) is guaranteed to be true and ONE.compareTo(TWO) is guaranteed to be less than one.

    Answer: B

    Question No: 163 – (Topic 2)

    Given:

    1. public class Person {

    2. private String name;

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

    4. public boolean equals(Person p) {

    5. return p.name.equals(this.name); 6. }

      7. }

      Which statement is true?

      1. When adding Person objects to a java.util.Set collection, the equals method in line 4 will prevent duplicates.

      2. Compilation fails because the private attribute p.name cannot be accessed in line 5.

      3. The equals method does NOT properly override the Object.equals method.

      4. To work correctly with hash-based data structures, this class must also implement the hashCode method.

        Answer: C

        Question No: 164 – (Topic 2)

        Given a correctly compiled class whose source code is:

        1. package com.sun.sjcp;

        2. public class Commander {

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

        4. // more code here 5. }

          6. }

          Assume that the class file is located in /foo/com/sun/sjcp/, the current directory is /foo/, and that the classpath contains quot;.quot; (current directory).

          Which command line correctly runs Commander?

          1. java Commander

          2. java com.sun.sjcp.Commander

          3. java com/sun/sjcp/Commander

          4. java -cp com/sun/sjcp Commander

          5. java -cp com.sun.sjcp Commander

Answer: B

Question No: 165 DRAG DROP – (Topic 2)

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 166 – (Topic 2)

A JavaBeans component has the following field:

11. private boolean enabled;

Which two pairs of method declarations follow the JavaBeans standard for accessing this field? (Choose two.)

  1. public void setEnabled( boolean enabled ) public boolean getEnabled()

  2. public boolean setEnabled( boolean enabled ) public boolean getEnabled()

  3. public void setEnabled( boolean enabled ) public void isEnabled()

  4. public void setEnabled( boolean enabled ) public boolean isEnabled()

    Answer: A,D

    Question No: 167 – (Topic 2)

    Given:

    1. package geometry;

    2. public class Hypotenuse {

    3. public InnerTriangle it = new InnerTriangle();

    4. class InnerTriangle {

    5. public int base;

    6. public int height; 7. }

      8. }

      Which statement is true about the class of an object that can reference the variable base?

      1. It can be any class.

      2. The class must belong to the geometry package.

      3. The class must be a subclass of the class Hypotenuse.

      4. No class has access to base.

Answer: B

Question No: 168 – (Topic 2)

A class games.cards.Poker is correctly defined in the jar file Poker.jar. A user wants to execute the main method of Poker on a UNIX system using the command:

java games.cards.Poker

What allows the user to do this?

  1. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include

    /stuff/java

  2. Put Poker.jar in directory /stuff/java, and set the CLASSPATH to include

    /stuff/java/Poker.jar

  3. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include

    /stuff/java/*.jar

  4. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include

    /stuff/java/Poker.jar

  5. put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/*.jar

  6. put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java

Answer: B

Question No: 169 – (Topic 2)

Which two statements are true? (Choose two.)

  1. An encapsulated class allows subclasses to overload methods, but does NOT allow overriding methods.

  2. An encapsulated, public class promotes re-use.

  3. Classes that share the same interface are always tightly encapsulated.

  4. An encapsulated class allows a programmer to change an implementation without affecting outside code.

Answer: B,D

Question No: 170 – (Topic 2)

Given:

  1. interface DeclareStuff {

  2. public static final int EASY = 3;

  3. void doStuff(int t); }

  4. public class TestDeclare implements DeclareStuff {

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

  6. int x = 5;

  7. new TestDeclare().doStuff( x);

18. }

  1. void doStuff(int s) {

  2. s = EASY s;

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

22. }

23. }

What is the result?

  1. Compilation fails.

  2. s 16

  3. s 14

  4. An exception is thrown at runtime.

  5. s 10

Answer: A

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