Test your knowledge
A functional interface is an interface that meets the following condition:
It uses a lambda expression in one of its default methods.
It has a single abstract method or a single method requirement.
It implements the
Lambda<T, U>
interface.
You can create an instance of a functional interface with:
Lambda expressions, method references, or constructor references.
Only lambda expressions. Method references and constructor references only work with
Predicate<T>
.Method references and constructor references. Lambda expressions only work with
Predicate<T>
.
The
IntPredicate
functional interface represents a function with:One argument of the
int
type that returns no result (void
).One argument of the
int
type that returns anInteger
result.One argument of the
int
type that returns aboolean
result.
When we apply a
filter
method to aStream<T>
, the method returns:A
Stream<T>
.A
List<T>
.A
Map<T, List<T>>
.
Which of the following code snippets...