A list is a collection that stores values in order. In Kotlin, listOf() creates a read-only list, while mutableListOf() creates a list you can add to, remove from, and change. It's used all the time for things like product lists, menu lists, and user lists in apps.
kotlin
fun main() {
val numbers = listOf(1, 2, 3)
println(numbers[0])
val fruits = mutableListOf("apple", "banana")
fruits.add("cherry")
println(fruits)
}You should see
1 [apple, banana, cherry]Summary
Once you understand lists, you can easily process groups of data with loop, filter, and map.