Example usage for java.util.stream LongStream filter

List of usage examples for java.util.stream LongStream filter

Introduction

In this page you can find the example usage for java.util.stream LongStream filter.

Prototype

LongStream filter(LongPredicate predicate);

Source Link

Document

Returns a stream consisting of the elements of this stream that match the given predicate.

Usage

From source file:Main.java

public static void main(String[] args) {
    LongStream b = LongStream.of(1L, 2L, 3L, 4L);

    b.filter(l -> l % 2 == 0);
    b.forEach(System.out::println);

}