Java Reference
In-Depth Information
The diamond operator.
It can be simplified by use of the diamond operator as shown here:
Chapter 14: Lambda Expressions and Method References
The lambda operator is
->
.
A functional interface is an interface that contains one and only one abstract method.
A lambda expression provides the implementation for the abstract method defined by
the functional interface. The functional interface defines the target type.
The two types of lambda expressions are expression lambdas and block lambdas. An
expression lambda specifies a single expression, whose value is returned by the
lambda. A block lambda contains a block of code. Its value is specified by a
return
statement.
ive.
question 5. Call the interface
MyTest
and its abstract method
testing( )
.
use. Use
NumericFunc
, shown in this chapter, for the functional interface.