SortArray2.java
Select all
/* SortArray2.java David G. Klick 2/1/06 CIS 260 This program demonstrates the built-in sort method of the Arrays utility class to sort an array of ints. */ import java.util.*; public class SortArray2 { public static void main(String[] args) { int[] n = { 8, -8, 13, 7, 42, 5 }; Arrays.sort(n); for (int i : n) System.out.print(i + " "); } }