In this chapter, we're going to explore Scala's collections classes and how to use them. Most Scala collection classes are immutable, meaning that once they are instantiated, the instances cannot be changed. You're used to immutability, as Java
Strings are immutable. The conjunction of collections being immutable and providing powerful iteration features leads to more concise, higher-performance code that does extremely well in multicore, multithreaded concurrency situations.
In Java, the most commonly used types are immutable. Once an instance is created, it cannot be changed. In Java,
String, int, long, double, and
boolean are all immutable data types. Of these, String is a ...