Garmaine Staff asked 2 years ago

I am solving a problem from Advent of Code, and trying to put the content of the input file into an arraylist, here's my code for that:

ArrayList<Integer> arrayList = new ArrayList<>();
    try (Scanner s = new Scanner(new File("input.txt")).useDelimiter(",")) {

        while (s.hasNext()) {
            int b = Integer.parseInt(;

    catch (FileNotFoundException e) {
        // Handle the potential exception


and when I run it, it does not print the arraylist. I can't understand why, could someone tell me what I did wrong?