ObjIntConsumer example
Description
ObjIntConsumer represents an operation that accepts an object-valued and a int-valued argument, and returns no result. This is the reference, int specialization of BiConsumer.
Example
The following example shows how to use ObjIntConsumer
.
import java.util.function.ObjIntConsumer;
//from w w w . j av a 2 s. c om
public class Main {
public static void main(String[] args) {
ObjIntConsumer<String> i = (s,d)->System.out.println(s+d);
i.accept("java2s.com ",234);
}
}
The code above generates the following result.
Home »
Java Lambda »
java.util.function Reference »
Java Lambda »
java.util.function Reference »