Here you can find the source of printArrayArray(ArrayList
public static final void printArrayArray(ArrayList<ArrayList<Integer>> matrix)
//package com.java2s; import java.util.ArrayList; public class Main { public static final void printArrayArray(ArrayList<ArrayList<Integer>> matrix) { for (int pos = 0; pos < matrix.size(); pos++) { ArrayList<Integer> list = matrix.get(pos); if (!list.isEmpty()) { String output = "pos = " + pos + ": ("; for (Integer i : list) { output = output + i + ","; }/* w w w. j a va 2s .co m*/ System.out.println(output + ")"); } } } }