1z0-819 Practice Test

1z0-819 Practice Test practice questions, page 6 of 9, with answer review and explanations.

Question 26

Given: and Which four identifiers from the Foo and Bar classes are visible at line 1? (Choose four.)

  1. e
  2. f
  3. A
  4. j
  5. d
  6. c
  7. i
  8. B
  9. h
  10. g

Question 27

Which code fragment represents a valid Comparator implementation?

Question 28

Given the code fragment: Which statement is true?

  1. It never finishes.
  2. The action of CyclicBarrier is called five times.
  3. It finishes without any exception.
  4. Threads in executorService execute for each of the two threads.

Question 29

Given: What prevents this code from compiling?

  1. The calculateSurfaceArea method within Cylinder must be declared default.
  2. Cylinder is not properly calling the Rectangle and Ellipse interfaces’ calculateSurfaceArea methods.
  3. Cylinder requires an implementation of calculateSurfaceArea with two parameters.
  4. The calculateSurfaceArea method within Rectangle and Ellipse requires a public access modifier.

Question 30

Given a Member class with fields for name and yearsMembership, including getters and setters and a print method, and a list of clubMembers members: Which two Stream methods can be changed to use method references? (Choose two.)

  1. .filter(Integer::equals(0))
  2. .map(testName::compareToIgnoreCase)
  3. .filter(Member::getYearsMembership() >= testMembershipLength)
  4. .peek(Member::print)