Swipe to navigate through the chapters of this book
The collections framework in Scala is a high-performance and type-parametrized framework with support for mutable and immutable type hierarchies. These distinct and independent mutable and immutable type hierarchies enable switching between mutable and immutable implementations much simpler. Scala’s object-oriented collections also support functional higher-order operations such as map, filter, and reduce that let you use expression-oriented programming in collections. You can access and use the entire Java collections library from your Scala code because Scala is a JVM language, but this is not recommended because higher-order operations are not available with Java Collections library. Scala has a rich collection library. This chapter gives you a tour of the most commonly used collection types and operations, showing just the types you will use most frequently. The goal of this chapter is to guide you through the myriad of options to find the solutions you need.
Please log in to get access to this content
To get access to this content you need the following product:
You can see exactly how Scala turns patterns into code by typing scalac -print FileName.scala. This will cause the Scala compiler to emit desugared code that looks strangely like Java code.
- Scala Collections
- Sequence number
- Chapter number
- Chapter 6