An Introduction to the Collection Library
In the following lesson, you will be introduced to Scala's collection library.
Introduction
You can think of collections as vessels used for collecting data and Scala has a vast library of them. Scala’s collection library is made up of classes and traits which provide you a plethora of built-in data structures and methods for collecting and manipulating data.
Traits is a topic for another course. For the scope of this course, you can safely assume that a trait is simply a class with its own members. An instance of a trait is identical to saying an instance of a class. Hence, we will be omitting the use of trait from this point onwards and just use the term class for both.
The focus of this chapter will be to simply introduce Scala’s collection library and focus on the syntax and implementation of the well-known/most used collections.
Each Scala collection is one of two types: mutable collection or ...