Instead of result = true;
you could just increment a counter inside your loop.
For example:
int counter = 0;
for ( int index = 0 ; index < winners.length ; index ++ )
{
if ( teamName.equals(winners[index]))
{
counter = counter + 1;
}
}
And you could then change the return type of your method to int
and return counter
.
A method that just returns true / false could use the new method. If the returned value is 0, it returns false, else true.