Answers for "how to input array of strings in java"

2

take string array input in java

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();


        }
Posted by: Guest on February-01-2021

Code answers related to "how to input array of strings in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language