public int index(String what){
  if (what == null) {
    for (int i=0; i < count; i++) {
      if (data[i] == null) {
        return i;
      }
    }
  }
 else {
    for (int i=0; i < count; i++) {
      if (what.equals(data[i])) {
        return i;
      }
    }
  }
  return -1;
}

public int index ( String what ) { if ( what == null ) { for ( int i = 0 ; i < count ; i ++ ) { if ( data [ i ] == null ) { return i ; } } } else { for ( int i = 0 ; i < count ; i ++ ) { if ( what . equals ( data [ i ] ) ) { return i ; } } } return - 1 ; }
return the first index of a particular value .
