Here you can find the source of join(Collection
public static String join(Collection<Character> data)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static String join(String[] strs) { return join(strs, ","); }//from w w w . ja v a 2 s. c om public static String join(String[] strs, String delim) { String rtn = ""; for (String str : strs) { rtn += str + delim; } return rtn.replaceFirst(delim + "$", ""); } public static String join(Collection<Character> data) { return join(data, ","); } public static String join(Collection<Character> data, String delim) { String rtn = ""; for (Character chr : data) { rtn += chr + delim; } return rtn.replaceFirst(delim + "$", ""); } }