copyToTop method

void copyToTop(
  1. int index
)

Copy the element at index to top of stack

Implementation

void copyToTop(int index) {
add(_list[_list.length - index -1]);
  }