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

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: 31 – (Topic 1)

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 instance of Forest and an instance of Tree are both serialized.

  2. An instance of Forest is serialized.

  3. Compilation fails.

  4. An exception is thrown at runtime.

Answer: D

Question No: 32 – (Topic 1)

Click the Exhibit button. What is the result?

Ensurepass 2018 PDF and VCE

  1. first second third snootchy 420

  2. snootchy 420 first second third

  3. third first second snootchy 420

  4. first second first third snootchy 420

  5. snootchy 420 third second first

  6. third second first snootchy 420

    Answer: F

    Question No: 33 – (Topic 1)

    Given:

    1. public class TestOne implements Runnable {

    2. public static void main (String[] args) throws Exception {

    3. Thread t = new Thread(new TestOne());

    4. t.start();

    5. System.out.print(quot;Startedquot;);

    6. t.join();

    7. System.out.print(quot;Completequot;); 8. }

9. public void run() {

10. for (int i = 0; i lt; 4; i ) {

11. System.out.print(i);

12. }

13. }

14. }

What can be a result?

  1. The code executes and prints quot;StartedCompletequot;.

  2. Compilation fails.

  3. The code executes and prints quot;Started0123Completequot;.

  4. The code executes and prints quot;StartedComplete0123quot;.

  5. An exception is thrown at runtime.

    Answer: C

    Question No: 34 – (Topic 1)

    Given:

    1. import java.util.*;

    2. public class WrappedString {

    3. private String s;

    4. public WrappedString(String s) { this.s = s; }

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

    6. HashSetlt;Objectgt; hs = new HashSetlt;Objectgt;();

    7. WrappedString ws1 = new WrappedString(quot;aardvarkquot;);

    8. WrappedString ws2 = new WrappedString(quot;aardvarkquot;);

    9. String s1 = new String(quot;aardvarkquot;);

    10. String s2 = new String(quot;aardvarkquot;);

    11. hs.add(ws1); hs.add(ws2); hs.add(s1); hs.add(s2);

    12. System.out.println(hs.size()); } } What is the result?

  1. Compilation fails.

  2. 1

  3. 4

  4. 2

  5. 0

  6. An exception is thrown at runtime.

  7. 3

Answer: G

Question No: 35 – (Topic 1)

Given:

  1. // some code here

  2. try {

  3. // some code here

  4. } catch (SomeException se) {

  5. // some code here

  6. } finally {

  7. // some code here

38. }

Under which three circumstances will the code on line 37 be executed? (Choose three.)

  1. The code on line 33 executes successfully.

  2. The code on line 33 throws an exception.

  3. The instance gets garbage collected.

  4. The code on line 31 throws an exception.

  5. The code on line 35 throws an exception.

Answer: A,B,E

Question No: 36 – (Topic 1)

Given:

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

  2. try {

  3. args = null;

  4. args[0] = quot;testquot;;

  5. System.out.println(args[0]);

  6. } catch (Exception ex) {

  7. System.out.println(quot;Exceptionquot;);

  8. } catch (NullPointerException npe) {

  9. System.out.println(quot;NullPointerExceptionquot;);

20. }

21. }

What is the result?

  1. test

  2. NullPointerException

  3. Exception

  4. Compilation fails.

Answer: D

Question No: 37 DRAG DROP – (Topic 1)

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 38 DRAG DROP – (Topic 1)

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 39 – (Topic 1)

Given a pre-generics implementation of a method:

  1. public static int sum(List list) {

  2. int sum = 0;

  3. for ( Iterator iter = list.iterator(); iter.hasNext(); ) {

  4. int i = ((Integer)iter.next()).intValue();

  5. sum = i;

16. }

17. return sum;

18. }

Which three changes must be made to the method sum to use generics? (Choose three.)

  1. replace line 13 with quot;for (int i : intList) {quot;

  2. replace the method declaration with quot;sum(Listlt;intgt; intList)quot;

  3. replace the method declaration with quot;sum(Listlt;Integergt; intList)quot;

  4. replace line 14 with quot;int i = iter.next();quot;

  5. replace line 13 with quot;for (Iterator iter : intList) {quot;

  6. remove line 14

    Answer: A,C,F

    Question No: 40 – (Topic 1)

    Given:

    1. public class Threads5 {

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

    3. new Thread(new Runnable() {

    4. public void run() {

    5. System.out.print(quot;barquot;); 6. }}).start();

      7. }

      8. }

      What is the result?

      1. Compilation fails.

      2. An exception is thrown at runtime.

      3. The code executes normally, but nothing prints.

      4. The code executes normally and prints quot;barquot;.

        Answer: D

        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.