/* SortArray1.java CIS 160 David Klick 2006-02-01 This program demonstrates the built-in sort method of the Arrays utility class to sort an array of objects that implement the Comparator interface. */ import java.util.Arrays; public class SortArray1 { public static void main(String[] args) { Integer[] n = { new Integer(8), new Integer(-8), new Integer(13), new Integer(7), new Integer(42), new Integer(5) }; Arrays.sort(n); for (Integer i : n) System.out.print(i + " "); } } /* Sample run: -8 5 7 8 13 42 */