17.12 Wrap-Up
In this chapter, you learned about Java SE 8’s new functional programming capabilities. We presented many examples, often showing simpler ways to implement tasks that you programmed in earlier chapters.
We overviewed the key functional programming technologies—functional interfaces, lambdas and streams. You learned how to process elements in an IntStream
—a stream of int
values. You created an IntStream
from an array of int
s, then used intermediate and terminal stream operations to create and process a stream pipeline that produced a result. You used lambdas to create anonymous methods that implemented functional interfaces.
We showed how to use a forEach
terminal operation to perform an operation on each stream element. We used ...
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.