Here you can find the source of println(Collection extends Object> lines, String suffix, String prefix)
public static void println(Collection<? extends Object> lines, String suffix, String prefix)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.List; public class Main { public static void println(Collection<? extends Object> lines, String suffix, String prefix) { System.out.println(toString(lines, suffix, prefix)); }// w w w. j av a 2 s . c om public static String toString(Collection<? extends Object> collection, String prefix, String suffix) { StringBuilder sb = new StringBuilder(); for (Object line : collection) { sb.append(prefix); sb.append(line.toString()); sb.append(suffix); } return sb.toString(); } public static String toString(List<List<String>> collection, String betweenElements, String betweenRows) { StringBuilder sb = new StringBuilder(); for (List<String> row : collection) { sb.append(row.get(0)); sb.append(betweenElements); sb.append(row.get(1)); sb.append(betweenRows); } return sb.toString(); } }