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

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: 171 – (Topic 2)

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. Compilation fails.

  2. An instance of Forest is serialized.

  3. An exception is thrown at runtime.

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

Answer: C

Question No: 172 – (Topic 2)

Given:

  1. Object [] myObjects = {

  2. new Integer(12),

  3. new String(quot;fooquot;),

  4. new Integer(5),

  5. new Boolean(true) 28. };

  1. Arrays.sort(myObjects);

  2. for(int i=0; ilt;myObjects.length; i ) {

  3. System.out.print(myObjects[i].toString());

  4. System.out.print(quot; quot;);

33. }

What is the result?

  1. A ClassCastException occurs in line 31.

  2. The value of all four objects prints in natural order.

  3. Compilation fails due to an error in line 23.

  4. A ClassCastException occurs in line 29.

  5. Compilation fails due to an error in line 29.

Answer: D

Question No: 173 – (Topic 2)

Given:

  1. rbo = new ReallyBigObject();

  2. // more code here

  3. rbo = null;

  4. /* insert code here */

Which statement should be placed at line 14 to suggest that the virtual machine expend effort toward recycling the memory used by the object rbo?

  1. Runtime.getRuntime().growHeap();

  2. System.freeMemory();

  3. System.gc();

  4. Runtime.getRuntime().freeMemory();

  5. Runtime.gc();

Answer: C

Question No: 174 – (Topic 2)

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. The programmer can replace StringBuffer with StringBuilder with no other changes.

  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. This code will perform well and converting the code to use StringBuilder will not enhance the performance.

Answer: A

Question No: 175 – (Topic 2)

Given:

foo and bar are public references available to many other threads. foo refers to a Thread and bar is an Object. The thread foo is currently executing bar.wait().

From another thread, what provides the most reliable way to ensure that foo will stop executing wait()?

  1. bar.notifyAll();

  2. Object.notify();

  3. Thread.notify();

  4. bar.notify();

  5. foo.notify();

  6. foo.notifyAll();

Answer: A

Question No: 176 DRAG DROP – (Topic 2)

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 177 – (Topic 2)

Given a valid DateFormat object named df, and

  1. Date d = new Date(0L);

  2. String ds = quot;December 15, 2004quot;;

  3. // insert code here

    What updates d#39;s value with the date represented by ds?

    1. 18. d = df.getDate(ds);

    2. 18. d = df.parse(ds);

    3. 18. try {

  4. d = df.parse(ds);

  5. } catch(ParseException e) { };

  1. 18. try {

  1. d = df.getDate(ds);

  2. } catch(ParseException e) { };

Answer: C

Question No: 178 – (Topic 2)

Given:

  1. try {

  2. // some code here

  3. } catch (NullPointerException e1) {

  4. System.out.print(quot;aquot;);

  5. } catch (RuntimeException e2) {

  6. System.out.print(quot;bquot;);

  7. } finally {

  8. System.out.print(quot;cquot;);

41. }

What is the result if a NullPointerException occurs on line 34?

  1. ab

  2. abc

  3. bc

  4. c

  5. ac

  6. a

Answer: E

Question No: 179 – (Topic 2)

Given:

  1. double input = 314159.26;

  2. NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN);

  3. String b;

  4. //insert code here

Which code, inserted at line 14, sets the value of b to 314.159,26?

  1. b = nf.parseObject( input );

  2. b = nf.parse( input );

  3. b = nf.format( input );

  4. b = nf.equals( input );

Answer: C

Question No: 180 – (Topic 2)

Given:

  1. public static Iterator reverse(List list) {

  2. Collections.reverse(list);

  3. return list.iterator();

14. }

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

  2. List list = new ArrayList();

  3. list.add(quot;1quot;); list.add(quot;2quot;); list.add(quot;3quot;);

  4. for (Object obj: reverse(list))

  5. System.out.print(obj quot;, quot;);

20. }

What is the result?

A. The code runs with no output.

B. 3, 2, 1,

  1. An exception is thrown at runtime.

  2. Compilation fails.

    E. 1, 2, 3,

    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.