//sorting the Array
import java.io.*;
import java.util.*;
class SortingArray
{
public static void main(String aa[])throws IOException
{
int arr[]=new int[10];
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter 10 elements in Array...");
for(int i=0;i<10;i++)
{
arr[i]=Integer.parseInt(br.readLine());
}
Arrays.sort(arr);
System.out.println("Sorted elements in Array...");
for(int i=0;i<10;i++)
{
System.out.println(" "+arr[i]);
}
}
}
Output |