...

Cloud Computing - SCALA

Back to Course

Lesson Description


Lession - #692 SCALA COLLECTION


SCALA Collection

Scala has a rich arrangement of collection library. collections are container of things. Those container can be sequenced, straight arrangements of things like List, Tuple, Option, Map, and so on. The collections might have an arbitary number of components or be limited to nothing or one component (e.g., Option>
.

collections might be strict or lazy. Lazy collections have components that may not consume memory until they are gotten to, similar to Ranges. Furthermore, collections might be variable (the objects in the reference can change>
or immutable (what a reference alludes to is rarely different>
. Note that immutable collections might contain variable things.

For certain issues, variable collections work better, and for other people, changeless collections work better. If all else fails, it is smarter to begin with an unchanging collection and change it later in the event that you really want variable ones.

This section illuminates the most normally utilized collection types and most often utilized tasks over those collections.

Collections with Description
1. Scala Lists
Scala's List[T] is a connected rundown of type T.

2. Scala Sets
A set is an collection of pairwise various components of a similar kind.

3. Scala Maps
A Map is an collection of key/esteem matches. Any worth can be recovered in view of its vital.

4. Scala Tuples
In contrast to an array or rundown, a tuple can hold objects with various sorts.

5. Scala Options
Option[T] gives a holder to nothing or one component of a given sort.

6. Scala Iterators
An iterator isn't an collection, but instead a method for getting to the components of an collection individually.