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 and as such it provides a rich immutable collection.
However, as mentioned in the Scala Introduction tutorial, Scala is also an Object Oriented programming language. So while you should try to avoid mutations in your code base, Scala also provides mutable collection for the cases when do you need mutations.
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 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!
Share this article on