Welcome back! In the last part of this series we took a quick look at how you declare immutable variables, then looked at the “everything is an object” features of Scala, and now we are going to jump back into some simple variable declarations, but this time we are going to look at creating mutable variables.
Mutable Variables
You might be wondering why we didn’t just go ahead and jump straight into mutable variables after discussing immutable variables, and the reason is that I wanted to give you a bit of advice before introducing them. Basically, Scala takes the stance that most things should be immutable and the developer should really only fall back to mutable objects when it makes sense from a complexity or performance standpoint.
