Here you can find the source of join(final List extends E> list, final CharSequence delim)
public static <E> String join(final List<? extends E> list, final CharSequence delim)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static <E> String join(final List<? extends E> list, final CharSequence delim) { final StringBuffer b = new StringBuffer(); boolean skip = true; for (final E e : list) { if (skip) { skip = false;/*from w w w . j a v a 2s . c o m*/ } else { b.append(delim); } b.append(e); } return b.toString(); } }