I am trying to read Integer value after I hit space but using scanner it only works after I press Enter. How can I make it read the integers after the white space?
This is my code:
for (i = 0; i< n; i++) {
scanner = new Scanner(System.in);
list.add(scanner.nextInt());
}