- Joined
- Mar 3, 2005
- Location
- Jacksonville, FL
Hey guys I'm working on a Java project and I got pretty much everything done but the search part. We're supposed to search array of objects and I'm little confused with what to pass as parameters for my search method.
Basically I have two arrays:
One array has all the data as array of objects.
Second array serves as search key which is also array of objects.
Here is the code (keep in mind this is just to test the first index in the array for the time being until I can get the code working)
Method:
And the part that gets me confused is that I can't pass it in the main without syntax error:
If anyone has any idea of what I'm doing wrong please let me know.
Basically I have two arrays:
One array has all the data as array of objects.
Second array serves as search key which is also array of objects.
Here is the code (keep in mind this is just to test the first index in the array for the time being until I can get the code working)
Method:
Code:
public void sequentialSearch(SearchCountry[] searchData)
{
searchData = searchList;
if (countryList[1].getCountryName().equals(searchData[1].getSearchName()))
System.out.println("Country Found");
else
System.out.println("Country Not Found");
}
And the part that gets me confused is that I can't pass it in the main without syntax error:
Code:
countryList.sequentialSearch(searchList);
If anyone has any idea of what I'm doing wrong please let me know.