IntBinaryOperator example
Description
IntBinaryOperator
represents an operation upon two int-valued operands and
producing an int-valued result.
This is the primitive type specialization of BinaryOperator
for int.
Example
The following example shows how to use IntBinaryOperator
.
import java.util.function.IntBinaryOperator;
/* w w w . j a v a2s .c o m*/
public class Main {
public static void main(String[] args) {
IntBinaryOperator io = (x,y)->x +y;
System.out.println(io.applyAsInt(2,3));
}
}
The code above generates the following result.
Home »
Java Lambda »
java.util.function Reference »
Java Lambda »
java.util.function Reference »