IntUnaryOperator applyAsInt applies this operator to the given operand.
applyAsInt
has the following syntax.
int applyAsInt(int operand)
The following example shows how to use applyAsInt
.
import java.util.function.IntUnaryOperator; public class Main { public static void main(String[] args) { IntUnaryOperator i = (x) -> x*x; System.out.println(i.applyAsInt(2)); } }
The code above generates the following result.