Skip to main content

Scala Collections

  • Chapter
  • First Online:
  • 2812 Accesses

Abstract

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    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.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Vishal Layka

About this chapter

Cite this chapter

Layka, V., Pollak, D. (2015). Scala Collections. In: Beginning Scala. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0232-6_6

Download citation

Publish with us

Policies and ethics