Created
March 27, 2018 06:57
-
-
Save kunals201/c2d55dcf560c994655f749962da8b30e to your computer and use it in GitHub Desktop.
takeWhile Example
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
public class Sample { | |
public static void main(String[] args) { | |
List<Integer> numbers = Arrays.asList(11, 22, 33, 44, 55, 66, 77, 88, 99); | |
numbers.stream() | |
.takeWhile(e -> e < 66) | |
.forEach(System.out::println); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment