17.3 IntStream Operations
[This section demonstrates how lambdas and streams can be used to simplify programming tasks that you learned in Chapter 7, Arrays and ArrayLists.]
Figure 17.5 demonstrates operations on an IntStream (package java.util.stream)—a specialized stream for manipulating int
values. The techniques shown in this example also apply to LongStream
s and DoubleStream
s for long
and double
values, respectively.
Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.