Practice mode Java

Which package contains the standard interfaces Predicate, Function and Supplier?

Correct answer C. java.util.function

Explanation

The java.util.function package holds general-purpose functional interfaces that serve as target types for lambdas and method references. Predicate tests a value, Function transforms one and Supplier produces one. The java.util.stream package uses these interfaces heavily, which makes it a tempting choice, but it defines stream types rather than these interfaces.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.