Here you can find the source of join(Collection strings, String separator)
public static String join(Collection strings, String separator)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static String join(String[] strings, String separator) { if (strings.length == 0) { return ""; }/*from w ww .j ava 2 s . c o m*/ StringBuffer list = new StringBuffer(strings[0]); for (int i = 1; i < strings.length; i++) list.append(separator + strings[i]); return list.toString(); } public static String join(Collection strings, String separator) { return join((String[]) strings.toArray(new String[0]), separator); } }