Chapter 8Collections

The Scala library contains a rich set of collections classes along with powerful operations to compose, iterate over, and extract elements. Working with these collections is commonplace when creating Scala applications. Learning these collections thoroughly is essential if you want to be productive in Scala.

In this chapter, you’ll learn how to create instances of common Scala collections and how to iterate through them. You can still use the collections from the JDK such as ArrayList, HashSet, and simple arrays, but in this chapter we’ll focus on the Scala-specific collections and how to work with them.

Get Pragmatic Scala 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.