You can do like this,
Collections.sort(matchedWords, new Comparator<String>() {
@Override
public int compare(String lhs, String rhs) {
return lhs.compareToIgnoreCase(rhs);
}
});
1
solved Collections.sort() not sort truely [closed]