I've created an ArrayList of doubles that is supposed to store values for all the doubles that the scanner detects, in cell++. However, when I run the code, the program keeps asking for a next input forever, and I don't know why.
For example if my input is 2, 3, 9, I want the program to store value 2 to the first cell of the arraylist, value 3 to the second and value 9 to the third. The problem is, if i fill in 2, 3, 9 in my interactions pane, it keeps asking for a next input forever.
ArrayList<Double> doubleList;
doubleList = new ArrayList<Double>();
while (scanner.hasNextDouble()) {
doubleList.add(scanner.nextDouble());
}