set

abstract operator override fun set(index: Int, element: E): E

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

Return

the element previously at the specified position for list of primitives and RealmObjects, but will return the newly imported object for lists of embedded objects, as the previous element will be deleted as part of clearing its parent.

the element previously at the specified position.