1z0-816 Java SE 11 Programmer II

Loading demo links...

Showing 7–9 of 10 questions

Question 7

Given:

What is required to make the Foo class thread safe?

Select an option, then click Submit answer.

  • No change is required.

  • Make the declaration of lock static.

  • Replace the lock constructor call with new ReentrantLock (true).

  • Move the declaration of lock inside the foo method.

Question 8

Which interface in the java.util.function package will return a void return type?

Select an option, then click Submit answer.

  • Supplier

  • Predicate

  • Function

  • Consumer

Question 9

Given:

What is the output?

Select an option, then click Submit answer.

  • :APPLE:ORANGE:BANANA appleorangebanana

  • :APPLE:ORANGE:BANANA

  • APPLE:apple
    ORANGE:orange
    BANANA:banana

  • appleorangebanana
    :APPLE:ORANGE:BANANA

  • apple:APPLE orange:ORANGE banana:BANANA