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

By | January 25, 2018

Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-808
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-808.html

Java SE 8 Programmer I

Question No: 31

Given:

Ensurepass 2018 PDF and VCE

What is the result?

A. 10:20

B. 0:20

  1. Compilation fails at line n1

  2. Compilation fails at line n2

Answer: D

Question No: 32

Given:

public class Test {

public static void main(String[] args) { int day = 1;

switch (day) {

case quot;7quot;: System.out.print(quot;Uranusquot;);

case quot;6quot;: System.out.print(quot;Saturnquot;);

case quot;1quot;: System.out.print(quot;Mercuryquot;);

case quot;2quot;: System.out.print(quot;Venusquot;);

case quot;3quot;: System.out.print(quot;Earthquot;);

case quot;4quot;: System.out.print(quot;Marsquot;);

case quot;5quot;: System.out.print(quot;Jupiterquot;);

}

}

}

Which two modifications, made independently, enable the code to compile and run?

  1. Adding a break statement after each print statement

  2. Adding a default section within the switch code-block

  3. Changing the string literals in each case label to integer

  4. Changing the type of the variable day to String

  5. Arranging the case labels in ascending order

Answer: A,C

Explanation: The following will work fine:

public class Test {

public static void main(String[] args) { int day = 1;

switch (day) {

case 7: System.out.print(quot;Uranusquot;); break; case 6: System.out.print(quot;Saturnquot;); break; case 1: System.out.print(quot;Mercuryquot;); break; case 2: System.out.print(quot;Venusquot;); break; case 3: System.out.print(quot;Earthquot;); break; case 4: System.out.print(quot;Marsquot;); break; case 5: System.out.print(quot;Jupiterquot;); break;

}

}

}

Question No: 33

Given the code fragment:

Ensurepass 2018 PDF and VCE

What is the result?

A. 1:2:3:4:5:

B. 1:2:3:

  1. Compilation fails.

  2. An ArrayoutofBoundsException is thrown at runtime.

Answer: A

Question No: 34

Given the code fragment:

Ensurepass 2018 PDF and VCE

Which statement is true?

  1. After line 8, three objects are eligible for garbage collection

  2. After line 8, two objects are eligible for garbage collection

  3. After line 8, one object is eligible for garbage collection

  4. After line 8, none of the objects are eligible for garbage collection

Answer: C

Question No: 35

Given the following classes:

Ensurepass 2018 PDF and VCE

Which two options fail to compile when placed at line n1 of the main method?

  1. employee.salary = 50_000;

  2. director.salary = 80_000;

  3. employee.budget = 200_000;

  4. manager.budget = 1_000_000;

  5. manager.stockOption = 500;

  6. director.stockOptions = 1_000;

Answer: C,E

Question No: 36

Given: package p1;

public class Test { static double dvalue; static Test ref;

public static void main(String[] args) { System.out.println(ref); System.out.println(dvalue);

}

}

What is the result?

  1. p1.Test.class 0.0

  2. lt;the summary address refrenced by refgt; 0.000000

  3. Null 0.0

  4. Compilation fails

  5. A NullPointerException is thrown at runtime

Answer: C

Question No: 37

Given the code fragment:

Ensurepass 2018 PDF and VCE

Which code fragment, when inserted at line 9, enables the code to print true?

  1. String str2 = str1;

  2. String str2 = new String (str1);

  3. String str2 = sb1. toString ();

  4. String str2 = quot;Dukequot;;

Answer: A

Question No: 38

Given:

Ensurepass 2018 PDF and VCE

What is the result?

Ensurepass 2018 PDF and VCE

  1. Option A

  2. Option B

  3. Option C

  4. Option D

Answer: B

Question No: 39

Given:

public class App {

// Insert code here

System.out.print(quot;Welcome to the world of Javaquot;);

}

}

Which two code fragments, when inserted independently at line // Insert code here, enable the program to execute and print the welcome message on the screen?

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

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

  3. public static void Main (String [] args) {

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

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

Answer: A,D Explanation: Incorrect:

Not B: No main class found.

Not C: Main method not found not E: Main method is not static.

Question No: 40

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. 1 1

    1

  2. 1 2

    3

  3. 2 3

    4

  4. Compilation fails

  5. The loop executes infinite times

Answer: E

100% Ensurepass Free Download!
Download Free Demo:1z0-808 Demo PDF
100% Ensurepass Free Guaranteed!
1z0-808 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.