Here you can find the source of join(Collection objects, String glue)
public static String join(Collection objects, String glue)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**/* w ww. j av a 2 s . c o m*/ * same thing as perl's join() */ public static String join(Collection objects, String glue) { StringBuilder builder = new StringBuilder(); for (Object o : objects) { builder.append(o); builder.append(glue); } builder.setLength(builder.length() - 1); return builder.toString(); } }