ObjIntConsumer accept example
Description
ObjIntConsumer accept performs this operation on the given arguments.
Syntax
accept
has the following syntax.
void accept(T t, int value)
Example
The following example shows how to use accept
.
import java.util.function.ObjIntConsumer;
/*www.ja v a2s .c o m*/
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 »