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
IntPredicatefunctional interface represents a function with:One argument of the
inttype that returns no result (void).One argument of the
inttype that returns anIntegerresult.One argument of the
inttype that returns abooleanresult.
When we apply a
filtermethod to aStream<T>, the method returns:A
Stream<T>.A
List<T>.A
Map<T, List<T>>.
Which of the following code snippets...