Here you can find the source of readSystemInToIntArrayList()
public static ArrayList<Integer> readSystemInToIntArrayList()
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Scanner; public class Main { public static ArrayList<Integer> readSystemInToIntArrayList() { ArrayList<Integer> array = new ArrayList<Integer>(); Scanner sc = new Scanner(System.in); while (sc.hasNextInt()) { array.add(sc.nextInt());/*from w ww . java2s .c o m*/ } sc.close(); return array; } }