Here you can find the source of join(String glue, Collection extends Object> c)
public static String join(String glue, Collection<? extends Object> c)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static String join(String glue, Collection<? extends Object> c) { StringBuilder buf = new StringBuilder(); for (Object o : c) { if (buf.length() > 0) { buf.append(glue);/*from w w w. ja v a2 s. c o m*/ } buf.append(o.toString()); } return buf.toString(); } }