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