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

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

Given:

  1. public class Yippee {

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

  3. for(int x = 1; x lt; args.length; x ) {

  4. System.out.print(args[x] quot; quot;);

19. }

20. }

21. }

and two separate command line invocations:

java Yippee

java Yippee 1 2 3 4 What is the result?

  1. An exception is thrown at runtime. 2 3 4

  2. No output is produced. 2 3 4

  3. No output is produced. 1 2 3

  4. An exception is thrown at runtime. 1 2 3 4

  5. An exception is thrown at runtime. 1 2 3

  6. No output is produced. 1 2 3 4

Answer: B

Question No: 152 – (Topic 2)

Which three will compile and run without exception? (Choose three.)

  1. private synchronized Object o;

  2. public synchronized void go() { /* code here */ }

  3. void go() {

    synchronized() { /* code here */ }

  4. void go() {

    Object o = new Object(); synchronized(o) { /* code here */ }

  5. void go() {

    synchronized(Object.class) { /* code here */ }

  6. private synchronized(this) void go() { /* code here */ }

Answer: B,D,E

Question No: 153 – (Topic 2)

A programmer needs to create a logging method that can accept an arbitrary number of arguments. For example, it may be called in these ways:

logIt(quot;log message1quot;);

logIt(quot;log message2quot;,quot;log message3quot;);

logIt(quot;log message4quot;,quot;log message5quot;,quot;log message6quot;); Which declaration satisfies this requirement?

  1. public void logIt(String * msgs)

  2. public void logIt(String… msgs)

  3. public void logIt(String [] msgs)

  4. public void logIt(String msg1, String msg2, String msg3)

Answer: B

Question No: 154 DRAG DROP – (Topic 2)

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 155 – (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 29.

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

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

  4. A ClassCastException occurs in line 31.

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

Answer: A

Question No: 156 – (Topic 2)

Given:

  1. Date date = new Date();

  2. df.setLocale(Locale.ITALY);

  3. String s = df.format(date);

The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?

  1. An exception is thrown at runtime.

  2. The value of s is Dec 14, 2000.

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

  4. The value of s is 14-dic-2004.

Answer: C

Question No: 157 – (Topic 2)

Given:

11. public enum Title {

12. MR(quot;Mr.quot;), MRS(quot;Mrs.quot;), MS(quot;Ms.quot;);

  1. private final String title;

  2. private Title(String t) { title = t; }

  3. public String format(String last, String first) {

  4. return title quot; quot; first quot; quot; last;

17. }

18. }

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

  2. System.out.println(Title.MR.format(quot;Doequot;, quot;Johnquot;));

21. }

What is the result?

  1. An exception is thrown at runtime.

  2. Compilation fails because of an error in line 15.

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

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

  5. Mr. John Doe

Answer: E

Question No: 158 DRAG DROP – (Topic 2)

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 159 – (Topic 2)

Assuming that the serializeBanana2() and the deserializeBanana2() methods will correctly use Java serialization and given:

  1. import java.io.*;

  2. class Food {Food() { System.out.print(quot;1quot;); } }

  3. class Fruit extends Food implements Serializable {

  4. Fruit() { System.out.print(quot;2quot;); } }

  5. public class Banana2 extends Fruit { int size = 42;

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

  7. Banana2 b = new Banana2();

  8. b.serializeBanana2(b); // assume correct serialization

  9. b = b.deserializeBanana2(b); // assume correct

  10. System.out.println(quot; restored quot; b.size quot; quot;); }

  11. // more Banana2 methods

24. }

What is the result?

  1. An exception is thrown at runtime.

  2. 12 restored 42

  3. 1212 restored 42

  4. Compilation fails.

  5. 121 restored 42

  6. 1 restored 42

    Answer: E

    Question No: 160 – (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. The class must belong to the geometry package.

      2. It can be any class.

      3. No class has access to base.

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

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.