views:

63

answers:

2

Hi there,

If i have an array of strings for example

Static final String[] TEST = new String[] { "g","a","b","t","e" };

How would i go about sorting this in alphabetical order please?

+1  A: 
import java.util.Arrays;

Arrays.sort(TEST);
bkail
cool thanks man
Capsud
A: 

Another example.

static final String[] TEST = "gabte".split("");
static {
   Arrays.sort(TEST);
}
Peter Lawrey