Created
August 16, 2019 08:09
-
-
Save mateuszmrozewski/c88092e98294b2b4ddaff8b20a02ec70 to your computer and use it in GitHub Desktop.
Example of functional interfaces in streams
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stream.generate(() -> Math.random()) | |
.mapToLong(x -> (long) (x * 10)) | |
.filter(x -> x % 2 == 0) | |
.limit(10) | |
.forEach(System.out::println); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment