Read values from a small typed list.

Arrays and Lists

ArraysLists.kt
fun main() {
    val bonus = 
    val scores = listOf(10, 20, 30)
    val first = scores[0]
    val adjusted = scores[1] + bonus
    val size = scores.size

    println("first=$first")
    println("adjusted=$adjusted")
    println("size=$size")
}
fun main() {
    val bonus = 
    val scores = listOf(10, 20, 30)
    val first = scores[0]
    val adjusted = scores[1] + bonus
    val size = scores.size

    println("first=$first")
    println("adjusted=$adjusted")
    println("size=$size")
}
fun main() {
    val bonus = 
    val scores = listOf(10, 20, 30)
    val first = scores[0]
    val adjusted = scores[1] + bonus
    val size = scores.size

    println("first=$first")
    println("adjusted=$adjusted")
    println("size=$size")
}
lists Lists keep several values in order and can be indexed.