📜  将扫描仪放入数组 - Java 代码示例

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

代码示例1
public static void main (String[] args)
{
    Scanner input = new Scanner(System.in);//create an object type Scanner which called "input"
    double[] numbers = new double[5];//creating an array type double

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