我改变了第一个 System.out.println 语句,但我仍然什么也没看到!!!我唯一得到的是构建成功,但没有用户输入的输出!
//initializes the array to have a limit of 10 numbers inputted
double[] numbers = new double [10];
// this loop reads in the numbers inputed from the array
for (int i = 0; i < numbers.length; i++) {
numbers[i] = input.nextDouble();
}
System.out.println("Enter " + numbers.length + " values: ");
java.util.Arrays.sort(numbers);// this is the Array.sort()method
// this loop sorts the numbers and then prints them
for(double number : numbers){
System.out.println(number);
}
}
}