📜  通过java代码示例中的扫描仪输入数组

📅  最后修改于: 2022-03-11 14:52:02.944000             🧑  作者: Mango

代码示例2
public static void main (String[] args)
{
    Scanner input = new Scanner(System.in);
    double[] numbers = new double[5];

    for (int i = 0; i < numbers.length; i++)
    {
        System.out.println("Please enter number");
        numbers[i] = input.nextDouble();
    }
}