I am writing a small Java program and need help using a simple search code. It is not compiling.
public int indexOf(EltType e) {
int i=0;
for (i = currsize; i < currsize; i++){
things[i] = e;
e.equalts(get(i));
}
return -1;
}
Basically I want to get the position number of each item it searches. Here is the method that calls it:
public void searchtester() {
MyList<String> searchlist = new MyList<String>();
searchlist.add("tangerine");
searchlist.add("apple");
searchlist.add("mango");
searchlist.add("lime");
searchlist.add("carrot");
for (int i = 0; i<searchlist.size(); i++)
System.out.println("searching for \"" + searchlist.get(i) + "\", result="
+ words.indexOf(searchlist.get(i)));
}
Please let me know what I am doing wrong.