[Free] 2018(Jan) EnsurePass Testking Oracle 1z0-854 Dumps with VCE and PDF 81-90

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

Given:

  1. class Super {

  2. private int a;

  3. protected Super(int a) { this.a = a; } 4. }

  1. class Sub extends Super {

  2. public Sub(int a) { super(a); }

  3. public Sub() { this.a = 5; }

14. }

Which two, independently, will allow Sub to compile? (Choose two.)

  1. Change line 2 to: protected int a;

  2. Change line 13 to: public Sub() { super(a); }

  3. Change line 13 to: public Sub() { this(5); }

  4. Change line 2 to:

    public int a;

  5. Change line 13 to: public Sub() { super(5); }

Answer: C,E

Question No: 82

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 14 with quot;int i = iter.next();quot;

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

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

  4. remove line 14

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

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

Answer: D,E,F

Question No: 83

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.parse( input );

  2. b = nf.equals( input );

  3. b = nf.parseObject( input );

  4. b = nf.format( input );

Answer: D

Question No: 84

Given:

  1. String test = quot;a1b2c3quot;;

  2. String[] tokens = test.split(quot;\\\\dquot;);

  3. for(String s: tokens) System.out.print(s quot; quot;); What is the result?

A. a1b2c3

B. 1 2 3

  1. a b c

  2. An exception is thrown at runtime.

  3. The code runs with no output.

  4. a1 b2 c3

  5. Compilation fails.

Answer: C

Question No: 85

Assuming that the serializeBanana() and the deserializeBanana() methods will correctly use Java serialization and given:

  1. import java.io.*;

  2. class Food implements Serializable {int good = 3;}

  3. class Fruit extends Food {int juice = 5;}

  4. public class Banana extends Fruit {

  5. int yellow = 4;

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

  7. Banana b = new Banana(); Banana b2 = new Banana();

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

  9. b2 = b.deserializeBanana(); // assume correct

  10. System.out.println(quot;restore quot; b2.yellow b2.juice b2.good);

24. }

25. // more Banana methods go here 50. } What is the result?

  1. restore 453

  2. Compilation fails.

  3. An exception is thrown at runtime.

  4. restore 400

  5. restore 403

Answer: A

Question No: 86

Click the Exhibit button.

Which three statements are true? (Choose three.)

Ensurepass 2018 PDF and VCE

  1. Compilation fails.

  2. The code compiles and the output is 2.

  3. If lines 16, 17 and 18 were removed, compilation would fail.

  4. If lines 24, 25 and 26 were removed, compilation would fail.

  5. If lines 16, 17 and 18 were removed, the code would compile and the output would be 2.

  6. If lines 24, 25 and 26 were removed, the code would compile and the output would be 1.

Answer: B,E,F

Question No: 87 DRAG DROP

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 88 DRAG DROP

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 89

A UNIX user named Bob wants to replace his chess program with a new one, but he is not sure where the old one is installed. Bob is currently able to run a Java chess program starting from his home directory /home/bob using the command:

java -classpath /test:/home/bob/downloads/*.jar games.Chess Bob#39;s CLASSPATH is set (at login time) to:

/usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/*.jar What is a possible location for the Chess.class file?

  1. /usr/lib/games/Chess.class

  2. /home/bob/games/Chess.class

  3. /home/bob/Chess.class

  4. /test/Chess.class

  5. inside jarfile /opt/java/lib/Games.jar (with a correct manifest)

  6. /test/games/Chess.class

  7. inside jarfile /home/bob/downloads/Games.jar (with a correct manifest)

    Answer: F

    Question No: 90

    Given:

    1. package com.company.application; 2.

  1. public class MainClass {

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

    And MainClass exists in the /apps/com/company/application directory. Assume the CLASSPATH environment variable is set to quot;.quot; (current directory).

    Which two java commands entered at the command line will run MainClass? (Choose two.)

    1. java com.company.application.MainClass if run from the /apps/com/company/application directory

    2. java -classpath . MainClass if run from the /apps/com/company/application directory

    3. java MainClass if run from the /apps directory

    4. java -classpath /apps/com/company/application:. MainClass if run from the /apps directory

    5. java -classpath /apps com.company.application.MainClass if run from any directory

    6. java com.company.application.MainClass if run from the /apps directory

Answer: E,F

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

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.