IntUnaryOperator identity returns a unary operator that always returns its input argument.
identity
has the following syntax.
static IntUnaryOperator identity()
The following example shows how to use identity
.
import java.util.function.IntUnaryOperator; public class Main { public static void main(String[] args) { IntUnaryOperator i = IntUnaryOperator.identity(); System.out.println(i.compose(i).applyAsInt(2)); } }
The code above generates the following result.