I am making a small programme, part of which iterates over an arraylist sorting the different competitors into a map depending on abilty of each competitor in the array list. It seems to work apart from one problem. The first if statement is not working. Any competitor classed as beginer is not sorted into beginerResults, but instead standardResults. The others are working fine however. Any suggestions?
public void sort()
{
for (Golfer rating : competitors)
{
if (competitors.getScore()== "beginer")
{
beginerResults.put(competitor.getName());
}
if (competitors.getScore()== "Intermediate")
{
intermediateResults.put(competitor.getName());
}
else
{
expertResults.put(age.getName());
}
}
}