1z0-808 Practice Test

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

Question 6

Given the code fragment: Which two modifications, made independently, enable the code to compile? (Choose two.)

  1. Make the method at line n1 public.
  2. Make the method at line n2 public.
  3. Make the method at line n3 public.
  4. Make the method at line n3 protected.
  5. Make the method at line n4 public.

Question 7

Given: And given the code fragment: What is the result?

  1. 4W 100 Auto 4W 150 Manual
  2. null 0 Auto 4W 150 Manual
  3. Compilation fails only at line n1
  4. Compilation fails only at line n2
  5. Compilation fails at both line n1 and line n2

Question 8

Given: What is the result?

  1. Compilation fails at line n1.
  2. Initialized Started Initialized
  3. Initialized Started
  4. Compilation fails at line n2.

Question 9

Given these two classes: Any amount of electricity used by a customer (represented by an instance of the Customer class) must contribute to the customer's bill (represented by the member variable bill) through the useElectricity method. An instance of the Customer class should never be able to tamper with or decrease the value of the member variable bill. How should you write methods in the ElectricAccount class at line n1 so that the member variable bill is always equal to the value of the member variable kwh multiplied by the member variable rate? A. B. C. D.

Question 10

Given the code fragment: What is the result?

  1. Match 1
  2. Match 2
  3. No Match
  4. A NullPointerException is thrown at runtime.