Scanner sc = new Scanner(System.in);
int[] arr = new int[6];
System.out.println("Enter the elements in the array");
for (int i = 0;i< arr.length;i++){
arr[i] = sc.nextInt();
}
Arrays.sort(arr);
for (int values : arr){
System.out.print(values +" ");
}