set

open operator override fun set(index: Int, element: T): T(source)

Replaces the element at index and returns the previous element.

Does not change size, shift other elements, or invalidate iterators.

Return

the element previously stored at index.

Parameters

index

zero-based element index, less than size.

element

replacement element.

Throws

if index is negative or at least size.