Here you can find the source of concatList(List extends Object> list)
public static String concatList(List<? extends Object> list)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static String concatList(List<? extends Object> list) { return concatList(list, "\n"); }/* w w w . j av a 2s .com*/ public static String concatList(List<? extends Object> list, String c) { String r = ""; for (Object o : list) { r += o.toString() + c; } return r; } public static String concatList(String l[]) { return concatList(l, "\n"); } public static String concatList(String l[], String c) { List<String> tmp = new ArrayList<String>(); for (int i = 0; i < l.length; i++) { if (l[i] != null) tmp.add(l[i]); } return concatList(tmp, c); } }