UNB/ CS/ David Bremner/ teaching/ java/ SearchVec.java
import java.util.Vector;

public class SearchVec extends Vector{

    public SearchVec(Object[] values){
        for (int i=0; i<values.length; i++){
            addElement(values[i]);
        }
    }
    
    public boolean search(Object o){
        for (int i=0; i<size(); i++){
            if (elementAt(i).equals(o))
                return true;
        }
        
        return false;
    }


    public static void main(String args[]){
    
      String[] names={"Bob","Doug","Alice"};
      
      SearchVec SV=new SearchVec(names);

      Integer I=new Integer(42);
      Integer J=new Integer(42);
      SV.add(I);
      System.out.println(SV.search("Hildergarde"));
      System.out.println(SV.search("Doug"));
      System.out.println(SV.search(J));
      

  }
}
    
//