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