java stream limit items

Solutions on MaxInterview for java stream limit items by the best coders in the world

showing results for - "java stream limit items"
Camilla
13 Jun 2020
1int maxNumberOfElements = 10;
2
3list.stream()
4    .limit(maxNumberOfElements);