public class StaticSorting
{
public static void main(String[] argv)
{
long t1, t2;
int max = 1000000;
t1=System.currentTimeMillis();
List myList = new ArrayList();
for(int i=0; i<max; i++){
myList.add("ABCDEFG"+Math.random()*100000);
}
Collections.sort(myList);
t2=System.currentTimeMillis();
Runtime rt = Runtime.getRuntime();
long memoryUsed = rt.totalMemory() - rt.freeMemory();
System.out.println(myList.get(0));
System.out.println("Time consumed="+(t2-t1)+" (ms) Memory used="+memoryUsed+ "(bytes)" );
}
}