get
Returns the element at the specified index in the list.
Since Kotlin
1.1Throws
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
val list = listOf(1, 2, 3)
println(list[0]) // 1
println(list[2]) // 3
// list[3] // will fail with IndexOutOfBoundsException
//sampleEnd
}