Collections - Creating Collections From Scratch - Scala Documentation

You have syntax List(1, 2, 3) to create a list of three integers and Map('A' -> 1, 'C' -> 2) to create a map with two bindings. This is actually a universal feature of Scala collections. You can take any collection name and follow it by a list of elements in parentheses. The result will be a new collection with the given elements. Here are some more examples:


This is a companion discussion topic for the original entry at http://docs.scala-lang.org//overviews/collections/creating-collections-from-scratch.html