import java.util.Scanner;

public class Sort{
    public static void main(String[] args) {
        String userInputStr;
        int numofNum;
        Scanner inputStream = new Scanner(System.in);

        System.out.print("how many values would you like to input?");
        userInputStr = inputStream.nextLine();
        numofNum = Integer.parseInt(userInputStr);

        double[] arr = new double [numofNum];  //creates array with doubles, numofNum number of values in the array
        for (int i=0; i<numofNum; i++)       //gets info from user for each spot in array
        {
            System.out.print("\nenter value: ");
            userInputStr = inputStream.nextLine();
            arr[i] = Double.parseDouble(userInputStr);
            System.out.print(arr[i]);
        }

        Arrays.sort(arr);   //sort array
        System.out.println("\n\nSorted Numbers: ");
        for (int i=0; i<numofNum; i++)       //prints each spot in array
        {
            System.out.print(arr[i]+ ", ");
        }
    }
}

Sort.main(null);
how many values would you like to input?
enter value: 3.2
enter value: 5.7
enter value: 1.2
enter value: 8.6
enter value: 5.4

Sorted Numbers: 
1.2, 3.2, 5.4, 5.7, 8.6,