Lists
Learn how to create, modify, and manipulate lists.
We'll cover the following...
We'll cover the following...
Creating a list
The list is the most basic type of collection. We can treat it as the default collection type. It represents an ordered list of elements.
Kotlin 1.5
fun main() {val list = listOf("A", "B", "C")println(list) // [A, B, C]}
Generic lists
Note that List is a generic class. The result type of listOf is List<T>, where T is the type of the elements in this list. ...