JAVA DEVELOPER SITE
 

Scala - Collections


Collections may be strict or lazy. Lazy collections have elements that may not consume memory until they are accessed, like Ranges.

mutable collections work better, and for others, immutable collections work better.

HERE,

Collections

Sr.No Collections with Description
1

Scala Lists

Scala's List[A] is a linked list of type A.

2

Scala Sets

A set is a collection of pairwise different elements of the same type.

3

Scala Maps

A Map is a collection of key/value pairs. Any value can be retrieved based on its key.

4

scala Tuples

Unlike an array or list, a tuple can hold objects with different types.

5

Scala Options

Option[A] provides a container for zero or one element of a given type.

6

Scala Iterators

An iterator is not a collection, but rather a way to access the elements of a collection one by one.