📜  在java代码示例中获取字符串数组输入

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

代码示例1
String[] array = new String[20];

        System.out.println("Please enter 20 names to sort");              
        Scanner s1 = new Scanner(System.in);
        for (int i = 0; i < 20;){

            array[i] = s1.nextLine();


        }