DoubleUnaryOperator identity returns a unary operator that always returns its input argument.
identity
has the following syntax.
static DoubleUnaryOperator identity()
The following example shows how to use identity
.
import java.util.function.DoubleUnaryOperator; //from w ww . ja va 2 s . c om public class Main { public static void main(String[] args) { DoubleUnaryOperator id = DoubleUnaryOperator.identity(); System.out.println(id.applyAsDouble(3.14)); } }
The code above generates the following result.