Here you can find the source of toString(List> list)
public static String toString(List<?> list)
//package com.java2s; //License from project: LGPL import java.util.List; public class Main { public static String toString(List<?> list) { String s = ""; for (int i = 0; i < list.size(); i++) { if (i > 0) s += ", "; Object o = list.get(i); s += o.toString();//from w ww .ja v a2 s . co m } return s; } }