Assuming that those are Strings, use the convenient static method sort… java.util.Collections.sort(listOfCountryNames)