How do you sort alphabet letters arrays using java?

Answer:

Let us assume by "alphabet letters arrays" you mean you have an array of chars.

char[] letters = //some character array

Arrays.sort(letters);

// Letters is now sorted.
// Note that letters will be sorted according to the ASCII values
// of the chars. This means that all capital letters will be sorted
// before lower case. ('Z' will come before 'a')

First answer by Moobler. Last edit by Moobler. Contributor trust: 354 [recommend contributor recommended]. Question popularity: 1 [recommend question].