Here you can find the source of join(String delimiter, Collection> a)
public static String join(String delimiter, Collection<?> a)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static String join(String delimiter, Collection<?> a) { if (a.isEmpty()) { return ""; }/*from w w w. jav a 2s . c o m*/ StringBuilder buffer = new StringBuilder(); for (Object o : a) { buffer.append(delimiter); buffer.append(o); } return buffer.substring(delimiter.length()); } }