[Free] 2018(Jan) EnsurePass Testinsides Oracle 1z0-853 Dumps with VCE and PDF 101-110

By | January 25, 2018

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: 101 – (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. An instance of Forest is serialized.

  2. Compilation fails.

  3. An exception is thrown at runtime.

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

Answer: C

Question No: 102 – (Topic 2)

Which two statements are true about the hashCode method? (Choose two.)

  1. The hashCode method for a given class can be used to test for object equality and object inequality for that class.

  2. The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.

  3. The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.

  4. The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.

  5. The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.

Answer: B,E

Question No: 103 – (Topic 2)

Given:

  1. public class Wow {

  2. public static void go(short n) {System.out.println(quot;shortquot;);}

  3. public static void go(Short n) {System.out.println(quot;SHORTquot;);}

  4. public static void go(Long n) {System.out.println(quot; LONGquot;);}

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

  6. Short y = 6;

  7. int z = 7;

  8. go(y);

  9. go(z);

21. }

22. }

What is the result?

  1. short LONG

  2. Compilation fails.

  3. SHORT LONG

  4. An exception is thrown at runtime.

Answer: B

Question No: 104 – (Topic 2)

Given:

  1. public class Person {

  2. private name;

  3. public Person(String name) {

  4. this.name = name;

15. }

  1. public int hashCode() {

  2. return 420;

18. }

19. }

Which statement is true?

  1. Deleting a Person key from a HashMap will delete all map entries for all keys of type Person.

  2. The time to find the value from HashMap with a Person key depends on the size of the map.

  3. The time to determine whether a Person object is contained in a HashSet is constant and does NOT depend on the size of the map.

  4. Inserting a second Person object into a HashSet will cause the first Person object to be removed as a duplicate.

Answer: B

Question No: 105 – (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. An instance of Forest and an instance of Tree are both serialized.

  2. An instance of Forest is serialized.

  3. An exception is thrown at runtime.

  4. Compilation fails.

    Answer: C

    Question No: 106 DRAG DROP – (Topic 2)

    Click the Task button.

    Ensurepass 2018 PDF and VCE

    Answer:

    Ensurepass 2018 PDF and VCE

    Question No: 107 – (Topic 2)

    Given:

    1. class Pizza {

    2. java.util.ArrayList toppings;

    3. public final void addTopping(String topping) {

    4. toppings.add(topping); 5. }

6. }

  1. public class PepperoniPizza extends Pizza {

  2. public void addTopping(String topping) {

  3. System.out.println(quot;Cannot add Toppingsquot;);

10. }

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

  2. Pizza pizza = new PepperoniPizza();

  3. pizza.addTopping(quot;Mushroomsquot;);

14. }

15. }

What is the result?

Ensurepass 2018 PDF and VCE

  1. The code runs with no output.

  2. Cannot add Toppings

  3. A NullPointerException is thrown in Line 4.

  4. Compilation fails.

Answer: D

Question No: 108 – (Topic 2)

Given:

11. public static void main(String[] args) { 12. for (int i = 0; i lt;= 10; i ) {

13. if (i gt; 6) break;

14. }

15. System.out.println(i);

16. }

What is the result?

  1. Compilation fails.

  2. 10

  3. 7

  4. 6

  5. 11

  6. An exception is thrown at runtime.

Answer: A

Question No: 109 – (Topic 2)

Given:

  1. interface Data { public void load(); }

  2. abstract class Info { public abstract void load(); }

Which class correctly uses the Data interface and Info class?

  1. public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ }

    public void Info.load() { /*do something*/ }

    }

  2. public class Employee extends Info implements Data public void load(){ /*do something*/ }

    public void Info.load(){ /*do something*/ }

    }

  3. public class Employee extends Info implements Data { public void load() { /*do something*/ }

    }

  4. public class Employee implements Info extends Data { public void Data.load(){ /*do something*/ }

    public void load(){ /*do something*/ }

    }

  5. public class Employee implements Info extends Data { public void load() { /*do something*/ }

    }

  6. public class Employee implements Info extends Data { public void load(){ /*do something*/ }

public void Info.load(){ /*do something*/ }

}

Answer: C

Question No: 110 – (Topic 2)

Given:

  1. public static void parse(String str) {

  2. try {

  3. float f = Float.parseFloat(str);

  4. } catch (NumberFormatException nfe) { 15. f = 0;

  1. } finally {

  2. System.out.println(f);

18. }

19. }

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

  2. parse(quot;invalidquot;);

22. }

What is the result?

  1. A NumberFormatException is thrown by the parse method at runtime.

  2. A ParseException is thrown by the parse method at runtime.

  3. Compilation fails.

D. 0.0

Answer: C

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.