Skip to content

Instantly share code, notes, and snippets.

@kunals201
Created March 27, 2018 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunals201/c2d55dcf560c994655f749962da8b30e to your computer and use it in GitHub Desktop.
Save kunals201/c2d55dcf560c994655f749962da8b30e to your computer and use it in GitHub Desktop.
takeWhile Example
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