code: public synchronized void removeElementAt(int index) {
          modCount++;
          if (index >= elementCount) {
              throw new ArrayIndexOutOfBoundsException(index + " >= " +
                                                       elementCount);
          }
          else if (index < 0) {
              throw new ArrayIndexOutOfBoundsException(index);
          }
          int j = elementCount - index - 1;
          if (j > 0) {
              System.arraycopy(elementData, index + 1, elementData, index, j);
          }
          elementCount--;
          elementData[elementCount] = null; /* to let gc do its work */
      }
docs: Deletes the component at the specified index. Each component in
  this vector with an index greater or equal to the specified
  {@code index} is shifted downward to have an index one
  smaller than the value it had previously. The size of this vector
  is decreased by {@code 1}.
  
  <p>The index must be a value greater than or equal to {@code 0}
  and less than the current size of the vector.
  
  <p>This method is identical in functionality to the {@link #remove(int)}
  method (which is part of the {@link List} interface).  Note that the
  {@code remove} method returns the old value that was stored at the
  specified position.
  
  @param      index   the index of the object to remove
  @throws ArrayIndexOutOfBoundsException if the index is out of range
  ({@code index < 0 || index >= size()})