Program to sort the elements of an array in ascending order

Source Code:

import java.util.Arrays;
public class SortAscending {
public static void main(String[] args) {
int[] a = {5, 2, 8, 1, 3};
Arrays.sort(a);
for(int i=0; i<a.length; i++) {
System.out.print(a[i] + " ");
}
}
}

Output: