public int indexOf(Object obj){ for (int i=0;i<numElems;i++) if (elements[i].equals(obj)) return i; return -1; }