Here you can find the source of join(final List
public static String join(final List<String> array, final String separator)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String join(final List<String> array, final String separator) { final StringBuilder buf = new StringBuilder(array.size() * 16); for (String str : array) { buf.append(str);//from ww w . ja v a 2 s . c om buf.append(separator); } buf.setLength(buf.length() - separator.length()); return buf.toString(); } }