In Scala programs, lists emerge as one of the most frequently employed data structures.
lists are immutable element values cannot be altered through assignment. Second, lists have a recursive, linked structure, in contrast to the flat nature of arrays.
In Scala, lists are homogeneous, meaning elements share the same type. List[T] denotes a list with elements of type T (see the examples above). Furthermore, Scala's list type is covariant, meaning if S is a subtype of T, then List[S] is a subtype of List[T].
[
add
]
[
|
|
...
]