// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.*;

public class SimpleSort {
    public static void main(String[] args) {
        List lst1 = new ArrayList();
        lst1.add("CCC");
        lst1.add("BB");
        lst1.add("A");
        System.out.println(lst1);
        String[] sa = new String[lst1.size()];
        for(int i = 0; i < sa.length; i++) sa[i] = (String)lst1.get(i);
        for(int i = 0; i < (sa.length-1); i++) {
            for(int j = (i+1); j < sa.length; j++) {
                if(sa[i].compareTo(sa[j]) > 0) {
                    String temp = sa[i];
                    sa[i] = sa[j];
                    sa[j] = temp;
                }
            }
        }
        List lst2 = new ArrayList();
        for(int i = 0; i < sa.length; i++) lst2.add(sa[i]);
        System.out.println(lst2);
    }
}
