The comments are true with respect to Maps and efficiency, and its arguable what's simple. Anyways, you can do a few neat tricks and get your solution by falling back to string manipulation only, without the need for sorting or multiple loops e.g.
public void theMostOftenClub() {
String[] football_club = {"Barcelona", "Real Madrid", "Chelsea", "Real Madrid", "Barcelona", "Barcelona"};
String arrayToString = Arrays.toString(football_club);
int length = arrayToString.length();
String result_club = "";
int count = 0;
for (String club : football_club) {
int clubLength = club.length();
int clubCount = (length - arrayToString.replace(club,"").length()) / clubLength;
if (count < clubCount) {
count = clubCount;
result_club = club;
}
}
System.out.println(result_club); // prints Barcelona
}
The two main lines
String arrayToString = Arrays.toString(football_club);
will give you a string equal to [Barcelona, Real Madrid, Chelsea, Real Madrid, Barcelona, Barcelona]
and
int clubCount = (length - arrayToString.replace(club,"").length()) / clubLength;
will give you a count of each word within a script