Adding an item to an immutable Seq

Use the :+ (append) operator to create a new Seq using: val seq = Seq(“a”, “b”) :+ “c” // seq is now (“a”,”b”,”c”) Note: :+ will create a new Seq object. If you have val mySeq = Seq(“a”,”b”) and you will call mySeq :+ “c” mySeq will still be (“a”,”b”) Note that some implementations of … Read more