I have a List<String> object that contains country names. How can I sort this list alphabetically?
List<String>
Assuming that those are Strings, use the convenient static method sort…
sort
java.util.Collections.sort(listOfCountryNames)
2.1m questions
2.1m answers
60 comments
57.0k users