Here you can find the source of toString(ArrayList
public static <T> String toString(ArrayList<T> arrayList)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static <T> String toString(ArrayList<T> arrayList) { StringBuilder builder = new StringBuilder(); for (T d : arrayList) { builder.append(d);/*w w w . j av a 2s . c o m*/ builder.append("\t"); } return builder.toString(); } }