1z0-808 Practice Test

1z0-808 Practice Test practice questions, page 5 of 10, with answer review and explanations.

Question 21

Given the code fragment: Which modification enables the code fragment to print TrueDone?

  1. Replace line 5 With String opt = "true"; Replace line 7 with case "true":
  2. Replace line 5 with boolean opt = l; Replace line 7 with case 1:
  3. At line 9, remove the break statement.
  4. Remove the default section.

Question 22

Given the following main method: What is the result?

  1. 5 4 3 2 1 0
  2. 5 4 3 2 1
  3. 4 2 1
  4. 5
  5. Nothing is printed

Question 23

Given the code fragment: What is the result?

  1. 100
  2. 101
  3. 102
  4. 103
  5. Compilation fails

Question 24

Given the code fragment: What is the result?

  1. Sum is 600
  2. Compilation fails at line n1.
  3. Compilation fails at line n2.
  4. A ClassCastException is thrown at line n1.
  5. A ClassCastException is thrown at line n2.

Question 25

Given the code fragment: Which two modifications, when made independently, enable the code to print joe:true: 100.0? (Choose two.)

  1. Option A
  2. Option B
  3. Option C
  4. Option D
  5. Option E