CHAPTER 3

image

Lambda’s Domain: Collections, Maps, and Streams

In the last chapter, we saw how lambdas themselves work, but we explicitly focused on lambdas without creating a context for their use. We extracted lambdas from their natural environment in order to analyze them under a microscope. In this chapter, we will begin to see lambdas in the wild.

Specifically, we will see how lambdas can be used with the familiar structures of collections and maps. However, collections and maps actually limit the power of lambdas. To get at their true power, Java introduced a new concept using an old word: streams. This chapter will close with an analysis of ...

Get Java Closures and Lambda 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.