set
Replaces the element at index without changing the list's size.
Invalid indexes are rejected by the implementation; ArrayList throws IllegalArgumentException.
Return
the previous element at index.
Parameters
index
zero-based element index, less than size.
element
replacement element.