LongConsumer example
Description
LongConsumer represents an operation that accepts a single long-valued argument and returns no result. This is the primitive type specialization of Consumer for long.
Example
The following example shows how to use LongConsumer
.
import java.util.function.LongConsumer;
/*from w w w . ja v a 2 s . c o m*/
public class Main {
public static void main(String[] args) {
LongConsumer i = (l) -> System.out.println(l);;
i.accept(Long.MAX_VALUE);
}
}
The code above generates the following result.
Home »
Java Lambda »
java.util.function Reference »
Java Lambda »
java.util.function Reference »