set

operator fun set(index: Int, element: T): T

Replaces the element at the specified position in this list with the specified element.

Return

The element previously at the specified position.

Parameters

index

Index of the element to replace.

element

Element to be stored at the specified position.

Throws

If the index exceeds the list's bounds.