I have a file with content like this:
123,412
345,634
124,645
I want to get just the numbers before the commas in each row and add them to my arrayList. Why does my code only add the first number (123) correctly but doesn't continue on to add the rest?
try {
File input = new File(filename);
in = new Scanner(input);
in.useDelimiter(",");
while(in.hasNextLine()) {
someArrayList.add(Integer.parseInt(in.next()));
}