Converting search method to find strings instead of integers
I'm writing a class, which currently includes a search method for finding integer variables within a text file. I need to change this to find strings in the same text file. I've tried changing this method, but have had no luck so far. The current code for the search method is as follows,
public Title lookUp2(String requiredDetails){
boolean found =false;
int next = 0;
while (!found && (next<TitleCount))
{
if ( TitleArray[next].getFilmName() == requiredDetails)
found =true;
else next++;
}
if (found)return TitleArray[next];
elsereturnnull;
}
The constructors for this class are currently,
public TitleList_1(int max){
TitleCount = 0; maxTitles=max;
TitleArray =new Title[max];
}
public TitleList_1(){
this(1000000);
}
public TitleList_1(SimpleReader in){
this(in.readInt());
int entries = in.readInt();
for (int i = 0; i><entries; i++)
add(new Title(in));
}
Any advice or help on how to change the above search method to allow me to search for strings as well as integers.>

