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