Use class
Arrays. This class contains various methods for manipulating arrays.
Info from API on
sort(int[] a)
Here is a nice
refference to sorting
An here is just small quick example
import java.util.*;
public class Sort {
public static void main(String[] args) {
int[] arr = new int[] {5, 3, 1, 6, 7};
Arrays.sort(arr);
for(int i =0; i< arr.length; i++)
{
System.out.print(arr[i] + " ");
}
System.out.println();
}
}