Here you can find the source of printArrayList(ArrayList
static public <T> void printArrayList(ArrayList<T> _array)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { static public <T> void printArrayList(ArrayList<T> _array) { System.out.print("["); for (int i = 0; i < _array.size(); i++) { String str = _array.get(i).toString(); System.out.print(str); }/*from w ww .java 2 s. c om*/ System.out.println("]"); } }