set method
Replaces the element at the specified index.
index the index of the element to replace
element the new element
Returns the previous element at the index
Implementation
E set(int index, E element) {
E oldElement = _list[index];
_list[index] = element;
return oldElement;
}