Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to get multiple integer input in java

    Scanner scanner = new Scanner(System.in);

    while(scanner.hasNext())
    {
        System.out.println(scanner.nextInt());
    }
Comment

how to get multiple integer input in java

String input = scanner.nextLine();    // get the entire line after the prompt 
String[] numbers = input.split(" "); // split by spaces
Comment

PREVIOUS NEXT
Code Example
Java :: java array remove space 
Java :: how to add elements to an array in java dynamically 
Java :: java random uuid 
Java :: what language is android written in 
Java :: java export image 
Java :: java filenotfoundexception 
Java :: intent in fragment android 
Java :: android alertdialog setSingleChoiceItems 
Java :: android create snackbar 
Java :: android check if app is running 
Java :: java array check duplicates 
Java :: java scanner netLine 
Java :: how to create a stack data structure in java? 
Java :: get last index of array java 
Java :: java const 
Java :: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException 
Java :: java tomorrow date 
Java :: set remove element java 
Java :: multiplication of two numbers in java using scanner 
Java :: how to use random bound on doubles java 
Java :: java text file to arraylist 
Java :: java set from string array 
Java :: A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution java.lang.reflect.InvocationTargetException (no error message) 
Java :: overloading + operator in java 
Java :: junit vintage engine maven 
Java :: java length of matrix 
Java :: android get distance between two locations kotlin 
Java :: set java path on linux ubuntu 
Java :: spring boot save file to static folder 
Java :: array.sort in java 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =