sort names in reverse order - Java
sortNamesReverse
Snippet Code
To sort a list of names alphabetically in reverse order.
import java.util.ArrayList;
import java.util.Collections;
ArrayList<String> names = new ArrayList<String>();
names.add("Stephen");
names.add("Albert");
names.add("Selvin");
Collections.sort(names);
Collections.reverse(names);
Tags