Chapter 7: A Beginner's Tutorial To Using Scala's Mutable Collection
In this section, we will go over how to use the Mutable Collection in the Scala programming language.
If you recall from the Scala Features Tutorial, as a functional programming language, Scala favours the use of immutability. However, there are certainly times when you need to make use of mutation in your codebase. As a result, Scala comes built-in with a suite of mutable collections.
Throughout the tutorials we will use the popular IntelliJ IDEA which we've setup in Chapter 1. I hope that by now you are more comfortable using IntelliJ. If not, feel free to review the previous tutorials from Chapter 1!
In this chapter, we will provide tutorials on the topics below. If none of these make any sense right now, that's OK :)
- How to use Scala's mutable Array
- How to use Scala's mutable ArrayBuffer
- How to use Scala's mutable ArrayStack
- How to use Scala's mutable ListBuffer
- How to use Scala's mutable Map
- How to use Scala's mutable HashMap
- How to use Scala's mutable ListMap
- How to use Scala's mutable LinkedHashMap
- How to use Scala's mutable Queue
- How to use Scala's mutable PriorityQueue
- How to use Scala's mutable Set
- How to use Scala's mutable SortedSet
- How to use Scala's mutable TreeSet
- How to use Scala's mutable HashSet
- How to use Scala's mutable LinkedHashSet
- How to use Scala's mutable BitSet
So let's get started!