Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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


        }
Comment

input array in String in java

import java.util.Scanner;
public class NameSorting {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        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 < 0;){

            array[i] = s1.nextLine();


        }


        //Just to test
        System.out.println(array[0]);

    }

}
Comment

PREVIOUS NEXT
Code Example
Java :: getcurrencyinstance java example 
Java :: java get all directories in path 
Java :: can strings be used in a 2 dimensional array in java 
Java :: iterable interface in java 
Java :: how to use deque as stack or queue in java? 
Java :: print list array 
Java :: image cropper implementation 
Java :: reentrantlock java 
Java :: How to generate all possible IP addresses based on a given set of digits, in Java? 
Java :: cannot find symbol variable log 
Java :: responseentity spring boot 
Java :: java create new arraylist with elements 
Java :: how to create an action listener in java 
Java :: generatedvalue spring boot 
Java :: how to check the current user in firebase android 
Java :: compare two character alphabetically java 
Java :: for loop javasctip 
Java :: java subscript numbers 
Java :: array sort java 
Java :: length of array in java 
Java :: java regex 
Java :: runtime intalize array in java 
Java :: how to find max in min in an array 
Java :: pointers in java 
Java :: how to use sql file in java 
Java :: java sort int array 
Java :: random int in range java 
Java :: how to find selenium webelement java 
Java :: make textview invisible android 
Java :: declaration of list in java 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =