Arrays class contains a method named sort for sorting an array,here is a simple example
import java.util.Arrays;
class ArraysExample1
{
public static void main(String args[])
{
int arr[] = {5,4,3,2,1};
Arrays.sort(arr);
for(int value:arr) { System.out.print(value+", ");}
}
}
This will produce result as 1, 2, 3, 4, 5,
brief read here:
Arrays (Java Platform SE 7 )[
^]