Here you can find the source of toString(List
private static <T> String toString(List<T> list)
//package com.java2s; /*// ww w . j av a 2 s . c o m // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. // You must accept the terms of that agreement to use this software. // // Copyright (C) 2003-2005 Julian Hyde // Copyright (C) 2005-2011 Pentaho // All Rights Reserved. */ import java.util.*; public class Main { private static <T> String toString(List<T> list) { StringBuilder buf = new StringBuilder(); int k = -1; for (T t : list) { if (++k > 0) { buf.append(", "); } buf.append(t); } return buf.toString(); } }