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

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: 1

Given:

20. public class CreditCard { 21.

  1. private String cardID;

  2. private Integer limit;

  3. public String ownerName; 25.

  1. public void setCardInformation(String cardID,

  2. String ownerName,

  3. Integer limit) {

  4. this.cardID = cardID;

  5. this.ownerName = ownerName;

  6. this.limit = limit;

32. }

33. }

Which statement is true?

  1. The ownerName variable breaks encapsulation.

  2. The class is fully encapsulated.

  3. The cardID and limit variables break polymorphism.

  4. The code demonstrates polymorphism.

  5. The setCardInformation method breaks encapsulation.

Answer: A

Question No: 2 DRAG DROP

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 3 DRAG DROP

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 4

Which three statements concerning the use of the java.io.Serializable interface are true?

(Choose three.)

  1. Objects from classes that use aggregation cannot be serialized.

  2. The values in fields with the transient modifier will NOT survive serialization and deserialization.

  3. It is legal to serialize an object of a type that has a supertype that does NOT implement java.io.Serializable.

  4. The values in fields with the volatile modifier will NOT survive serialization and deserialization.

  5. An object serialized on one JVM can be successfully deserialized on a different JVM.

Answer: B,C,E

Question No: 5

Which two code fragments will execute the method doStuff() in a separate thread? (Choose two.)

  1. new Thread() {

    public void start() { doStuff(); }

    };

  2. new Thread() {

    public void run() { doStuff(); }

    };

  3. new Thread(new Runnable() { public void run() { doStuff(); }

    }).start();

  4. new Thread() {

    public void start() { doStuff(); }

    }.run();

  5. new Thread(new Runnable() { public void run() { doStuff(); }

    }).run();

  6. new Thread() {

public void run() { doStuff(); }

}.start();

Answer: C,F

Question No: 6

Given:

  1. import java.io.*;

  2. public class Forest implements Serializable {

  3. private Tree tree = new Tree();

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

  5. Forest f = new Forest();

  6. try {

  7. FileOutputStream fs = new FileOutputStream(quot;Forest.serquot;);

  8. ObjectOutputStream os = new ObjectOutputStream(fs);

  9. os.writeObject(f); os.close();

  10. } catch (Exception ex) { ex.printStackTrace(); } 22. } }

23.

24. class Tree { } What is the result?

  1. An exception is thrown at runtime.

  2. An instance of Forest is serialized.

  3. An instance of Forest and an instance of Tree are both serialized.

  4. Compilation fails.

    Answer: A

    Question No: 7

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

      2. An exception is thrown at runtime.

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

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

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

      6. test

        Answer: F

        Question No: 8 DRAG DROP

        Click the Task button.

        Ensurepass 2018 PDF and VCE

        Answer:

        Ensurepass 2018 PDF and VCE

        Question No: 9

        Given:

        1. public class Boxer1{

        2. Integer i;

        3. int x;

        4. public Boxer1(int y) {

        5. x = i y;

        6. System.out.println(x); 7. }

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

  2. new Boxer1(new Integer(4));

    10. }

    11. }

    What is the result?

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

    2. A NullPointerException occurs at runtime.

    3. Compilation fails because of an error in line 9.

    4. A NumberFormatException occurs at runtime.

    5. The value quot;4quot; is printed at the command line.

    6. An IllegalStateException occurs at runtime.

      Answer: B

      Question No: 10

      Given:

      10: public class Hello { 11: String title;

      12: int value;

      13: public Hello() { 14: title = quot; Worldquot;; 15: }

      16: public Hello(int value) { 17: this.value = value;

      18: title = quot;Helloquot;; 19: Hello();

      20: }

      21: }

      and:

      30: Hello c = new Hello(5); 31: System.out.println(c.title);

      What is the result?

      1. The code runs with no output.

      2. Hello

      3. Hello World 5

      4. Compilation fails.

      5. An exception is thrown at runtime.

      6. Hello World

      Answer: 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.