Java tutorial
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; public class Main { public static void main(String args[]) { String init[] = { "One", "Two", "Three", "One", "from java2s.com", "Three" }; // create one list List<String> list = new ArrayList<String>(Arrays.asList(init)); System.out.println("List value before: " + list); // sort the list Collections.sort(list); System.out.println("List value after sort: " + list); } }