how to get multiple integer input in java

Solutions on MaxInterview for how to get multiple integer input in java by the best coders in the world

showing results for - "how to get multiple integer input in java"
Leia
01 Mar 2016
1String input = scanner.nextLine();    // get the entire line after the prompt 
2String[] numbers = input.split(" "); // split by spaces
Warren
05 Apr 2019
1    Scanner scanner = new Scanner(System.in);
2
3    while(scanner.hasNext())
4    {
5        System.out.println(scanner.nextInt());
6    }