import sort.InsertionSort; import sort.QuickSort; import sort.Sort; /* * Created on 24 oct. 2004 * */ /** * @author baudon * */ public class TestSort { public static > void sortAndPrintArray( T[] a, Sort sort) { sort.doSort(a); for (T t : a) { System.out.print(t + " "); } System.out.println(); } public static void main(String[] args) { String[] args2 = new String[args.length]; System.arraycopy(args, 0, args2, 0, args.length); sortAndPrintArray(args2, new InsertionSort()); System.arraycopy(args, 0, args2, 0, args.length); sortAndPrintArray(args2, new QuickSort()); } }