import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
public class Sorts {
static public class Comp implements Comparator<Integer> {
public int compare(Integer arg0, Integer arg1) {
return arg1 - arg0;
}
}
public static void main(String[] args) {
Integer a[] = {1, 3, 5, 2, 4, 6};
ArrayList<Integer> b = new ArrayList<Integer>(Arrays.asList(a));
out(a);
Arrays.sort(a);
out(a);
Arrays.sort(a, 1, 5, new Comp());
out(a);
out(b.toArray(new Integer[]{}));
Collections.sort(b);
out(b.toArray(new Integer[]{}));
}
private static void out(Integer[] a) {
for (int x : a) {
System.out.print(x + " ");
}
System.out.println();
}
}