add

fun add(element: T): Boolean

Appends the specified element to the end of this list.

Parameters

element

Element to be appended to this list.


fun add(index: Int, element: T)

Inserts the specified element at the specified position in this list.

Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters

index

Index at which the specified element is to be inserted.

element

Element to be inserted.

Throws

If the index exceeds the list's bounds.