Arrays of objects
So I have an array of objects of a bank account. I need to have a search method that will search the array based on the account's name and return the account's information.
public String linearSearch (Banking[] bankArray, String key,int counter)
{
for (int i = 0; i < counter; i++)
{
if (key.equals(bankArray[i]).getAccountName)
return bankAccount[i].getAccountName;
}//End For
return"Nothing Found";
}//End linearSearch
This method (is supposed to) search the array based on the "getAccountName" field of the objects in the array...but it
s not working. is there another comparison method I should be using besides .equal?

