Here you can find the source of join(Collection c, String separator)
public static String join(Collection c, String separator)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static String join(Collection c, String separator) { boolean was = false; String result = ""; for (Object o : c) { if (was) result += separator;//from w w w .j a v a 2 s . co m result += o; was = true; } return result; } }