Here you can find the source of join(final Collection> coll, final String glue)
public static String join(final Collection<?> coll, final String glue)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static String join(final Collection<?> coll, final String glue) { return join(coll.toArray(new Object[coll.size()]), glue); }/*from w ww. j a va 2 s. c om*/ public static String join(final Object[] list, final String glue) { StringBuilder ret = new StringBuilder(100); for (int i = 0; i < list.length; i++) { if (i != 0) { ret.append(glue); } ret.append(list[i]); } return ret.toString(); } }