public void reverse() { for (int i = 0; i < size/2; i++) { int temp = get(i); elementData[i] = elementData[size-i-1]; elementData[size-i-1] = temp; } }